mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-04-12 00:00:26 +08:00
Merge pull request #59674 from jennybuckley/codegen
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. code-gen: output golint compliant 'Generated by' comment New PR instead of reopening #58115 because /reopen did not work. This won't be ready to merge until the upstream https://github.com/kubernetes/gengo/pull/94 merges. Once that merges, the second commit will be changed to godep-save.sh and update-staging-godeps.sh, and the last commit will be changed to update-all.sh The failing test is due to the upstream changes not being merged yet ```devel-release-note Go code generated by the code generators will now have a comment which allows them to be easily identified by golint ``` Fixes #56489 Kubernetes-commit: 1eb1c00c44f8f597b9b23a05cd0a8da205c87f8a
This commit is contained in:
-1
@@ -193,7 +193,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
|
||||
packages := generator.Packages{}
|
||||
header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...)
|
||||
header = append(header, []byte("\n// This file was autogenerated by conversion-gen. Do not edit it manually!\n\n")...)
|
||||
|
||||
// Accumulate pre-existing conversion functions.
|
||||
// TODO: This is too ad-hoc. We need a better way.
|
||||
|
||||
-8
@@ -62,12 +62,6 @@ func DefaultNameSystem() string {
|
||||
return "public"
|
||||
}
|
||||
|
||||
// generatedBy returns information about the arguments used to invoke
|
||||
// lister-gen.
|
||||
func generatedBy() string {
|
||||
return fmt.Sprintf("\n// This file was automatically generated by informer-gen\n\n")
|
||||
}
|
||||
|
||||
// objectMetaForPackage returns the type of ObjectMeta used by package p.
|
||||
func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) {
|
||||
generatingForPackage := false
|
||||
@@ -111,8 +105,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
glog.Fatalf("Failed loading boilerplate: %v", err)
|
||||
}
|
||||
|
||||
boilerplate = append(boilerplate, []byte(generatedBy())...)
|
||||
|
||||
customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs)
|
||||
if !ok {
|
||||
glog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs)
|
||||
|
||||
-8
@@ -62,12 +62,6 @@ func DefaultNameSystem() string {
|
||||
return "public"
|
||||
}
|
||||
|
||||
// generatedBy returns information about the arguments used to invoke
|
||||
// lister-gen.
|
||||
func generatedBy() string {
|
||||
return fmt.Sprintf("\n// This file was automatically generated by lister-gen\n\n")
|
||||
}
|
||||
|
||||
// Packages makes the client package definition.
|
||||
func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages {
|
||||
boilerplate, err := arguments.LoadGoBoilerplate()
|
||||
@@ -75,8 +69,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
glog.Fatalf("Failed loading boilerplate: %v", err)
|
||||
}
|
||||
|
||||
boilerplate = append(boilerplate, []byte(generatedBy())...)
|
||||
|
||||
var packageList generator.Packages
|
||||
for _, inputDir := range arguments.InputDirs {
|
||||
p := context.Universe.Package(inputDir)
|
||||
|
||||
Reference in New Issue
Block a user