sealerio/sealer

vendor upstream package instead of copying upstream pkg's file directly to sealer's code

Open

#1,506 opened on Jun 13, 2022

 (0 comments) (0 reactions) (0 assignees)Go (357 forks)github user discovery
help wantedkind/feature

Repository metrics

Stars
 (2,095 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide