Remove gengo verify-only - unused and untested

All of our own tools emit into a tmp tree and then diff that.
This commit is contained in:
Tim Hockin 2024-01-16 18:25:48 -08:00
parent d0dd72b01e
commit 3a77592b2c
No known key found for this signature in database
2 changed files with 3 additions and 13 deletions

View File

@ -33,7 +33,6 @@ GOPROXY=off go install k8s.io/code-generator/cmd/import-boss
$(kube::util::find-binary "import-boss") \ $(kube::util::find-binary "import-boss") \
-v "${KUBE_VERBOSE:-0}" \ -v "${KUBE_VERBOSE:-0}" \
--include-test-files \ --include-test-files \
--verify-only \
--input-dirs "./pkg/..." \ --input-dirs "./pkg/..." \
--input-dirs "./cmd/..." \ --input-dirs "./cmd/..." \
--input-dirs "./plugin/..." \ --input-dirs "./plugin/..." \

View File

@ -70,7 +70,6 @@ func New() *Generator {
func (g *Generator) BindFlags(flag *flag.FlagSet) { func (g *Generator) BindFlags(flag *flag.FlagSet) {
flag.StringVarP(&g.Common.GoHeaderFilePath, "go-header-file", "h", g.Common.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") flag.StringVarP(&g.Common.GoHeaderFilePath, "go-header-file", "h", g.Common.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.")
flag.BoolVar(&g.Common.VerifyOnly, "verify-only", g.Common.VerifyOnly, "If true, only verify existing output, do not write anything.")
flag.StringVarP(&g.Packages, "packages", "p", g.Packages, "comma-separated list of directories to get input types from. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") flag.StringVarP(&g.Packages, "packages", "p", g.Packages, "comma-separated list of directories to get input types from. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.")
flag.StringVar(&g.APIMachineryPackages, "apimachinery-packages", g.APIMachineryPackages, "comma-separated list of directories to get apimachinery input types from which are needed by any API. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") flag.StringVar(&g.APIMachineryPackages, "apimachinery-packages", g.APIMachineryPackages, "comma-separated list of directories to get apimachinery input types from which are needed by any API. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.")
flag.StringVar(&g.OutputDir, "output-dir", g.OutputDir, "The base directory under which to generate results.") flag.StringVar(&g.OutputDir, "output-dir", g.OutputDir, "The base directory under which to generate results.")
@ -85,11 +84,6 @@ func (g *Generator) BindFlags(flag *flag.FlagSet) {
// This roughly models gengo/v2/args.GeneratorArgs.Execute. // This roughly models gengo/v2/args.GeneratorArgs.Execute.
func Run(g *Generator) { func Run(g *Generator) {
if g.Common.VerifyOnly {
g.OnlyIDL = true
g.Clean = false
}
// Roughly models gengo/v2/args.GeneratorArgs.NewBuilder. // Roughly models gengo/v2/args.GeneratorArgs.NewBuilder.
b := parser.NewWithOptions(parser.Options{BuildTags: []string{"proto"}}) b := parser.NewWithOptions(parser.Options{BuildTags: []string{"proto"}})
@ -154,7 +148,6 @@ func Run(g *Generator) {
log.Fatalf("Failed making a context: %v", err) log.Fatalf("Failed making a context: %v", err)
} }
c.Verify = g.Common.VerifyOnly
c.FileTypes["protoidl"] = NewProtoFile() c.FileTypes["protoidl"] = NewProtoFile()
// Roughly models gengo/v2/args.GeneratorArgs.Execute calling the // Roughly models gengo/v2/args.GeneratorArgs.Execute calling the
@ -202,13 +195,11 @@ func Run(g *Generator) {
} }
c.Namers["proto"] = protobufNames c.Namers["proto"] = protobufNames
if !g.Common.VerifyOnly {
for _, p := range outputPackages { for _, p := range outputPackages {
if err := p.(*protobufPackage).Clean(); err != nil { if err := p.(*protobufPackage).Clean(); err != nil {
log.Fatalf("Unable to clean package %s: %v", p.Name(), err) log.Fatalf("Unable to clean package %s: %v", p.Name(), err)
} }
} }
}
if g.Clean { if g.Clean {
return return