sealerio/sealer
vendor upstream package instead of copying upstream pkg's file directly to sealer's code
开放
#1,506 创建于 2022年6月13日
help wantedkind/feature
仓库指标
- 星标
- (2,096 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
When I was learning sealer's source code, almost all of sealer's code is quite high-quality, especially the design part. While there is still something which could be improved, in my opinion.
vendor upstream pkg instead of directly copying to repo may be the part that we could improve.
We know that directly copying upstream file is quite convenient when coding. While it may bring some other side-effect:
- lose the track of current file and upstream file;
- make others confuse that if it is a direct copy from upstream or hacker added some customized code there. In result, the maintain effort of that file could be quite huge.
- the version control of that file is quite difficult.
Here are some examples that I use grep The Kubernetes Authors. which means the file is copied from somewhere else:
- go/src/github.com/sealerio/sealer/pkg/debug/resize.go
- go/src/github.com/sealerio/sealer/pkg/debug/resizeevents.go
- go/src/github.com/sealerio/sealer/pkg/debug/term..go
- go/src/github.com/sealerio/sealer/pkg/runtime/kubeadm_types/v1beta2/types.go which is related to some issue https://github.com/sealerio/sealer/issues/1484
If they are just copied from upstream, I wish to vendor them within go vendor packages policies.