mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
No need to check nil iterating gengo Inputs
This commit is contained in:
parent
7a084b3352
commit
242b4e27c0
@ -225,10 +225,6 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
klog.V(3).Infof("pre-processing pkg %q", i)
|
||||
|
||||
pkg := context.Universe[i]
|
||||
if pkg == nil {
|
||||
// If the input had no Go files, for example.
|
||||
continue
|
||||
}
|
||||
|
||||
// Only generate conversions for packages which explicitly request it
|
||||
// by specifying one or more "+k8s:conversion-gen=<peer-pkg>"
|
||||
|
@ -138,11 +138,8 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
|
||||
for _, i := range context.Inputs {
|
||||
klog.V(3).Infof("Considering pkg %q", i)
|
||||
|
||||
pkg := context.Universe[i]
|
||||
if pkg == nil {
|
||||
// If the input had no Go files, for example.
|
||||
continue
|
||||
}
|
||||
|
||||
ptag := extractEnabledTag(pkg.Comments)
|
||||
ptagValue := ""
|
||||
|
@ -244,10 +244,6 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
klog.V(5).Infof("considering pkg %q", i)
|
||||
|
||||
pkg := context.Universe[i]
|
||||
if pkg == nil {
|
||||
// If the input had no Go files, for example.
|
||||
continue
|
||||
}
|
||||
|
||||
// if the types are not in the same package where the defaulter functions to be generated
|
||||
inputTags := extractInputTag(pkg.Comments)
|
||||
@ -299,10 +295,6 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
|
||||
for _, i := range context.Inputs {
|
||||
pkg := context.Universe[i]
|
||||
if pkg == nil {
|
||||
// If the input had no Go files, for example.
|
||||
continue
|
||||
}
|
||||
|
||||
// typesPkg is where the types that needs defaulter are defined.
|
||||
// Sometimes it is different from pkg. For example, kubernetes core/v1
|
||||
|
@ -187,11 +187,8 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
|
||||
for _, i := range context.Inputs {
|
||||
klog.V(5).Infof("Considering pkg %q", i)
|
||||
|
||||
pkg := context.Universe[i]
|
||||
if pkg == nil {
|
||||
// If the input had no Go files, for example.
|
||||
continue
|
||||
}
|
||||
|
||||
ptag := extractTag(tagEnabledName, pkg.Comments)
|
||||
pkgNeedsGeneration := false
|
||||
|
Loading…
Reference in New Issue
Block a user