sealerio/sealer

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

Ouverte

#1 506 ouverte le 13 juin 2022

 (0 commentaire) (0 réaction) (0 personne assignée)Go (357 forks)github user discovery
help wantedkind/feature

Métriques du dépôt

Stars
 (2 096 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur