mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Remove useless conversion-gen pre-filter
This commit is contained in:
parent
87abf78bb7
commit
210a634bcc
@ -254,33 +254,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
getManualDefaultingFunctions(context, context.Universe[pp], manualDefaults)
|
||||
}
|
||||
|
||||
pkgNeedsGeneration := false
|
||||
for _, t := range pkg.Types {
|
||||
// Check whether this type can be auto-converted to the peer
|
||||
// package type.
|
||||
peerType := getPeerTypeFor(context, t, peerPkgs)
|
||||
if peerType == nil {
|
||||
// We did not find a corresponding type.
|
||||
continue
|
||||
}
|
||||
if namer.IsPrivateGoName(peerType.Name.Name) {
|
||||
// We won't be able to convert to a private type.
|
||||
glog.V(5).Infof(" found a peer type %v, but it is a private name", t)
|
||||
continue
|
||||
}
|
||||
|
||||
// If we can generate conversion in any direction, we should
|
||||
// generate this package.
|
||||
if isConvertible(t, peerType, manualConversions) || isConvertible(peerType, t, manualConversions) {
|
||||
pkgNeedsGeneration = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !pkgNeedsGeneration {
|
||||
glog.V(5).Infof(" no viable conversions, not generating for this package")
|
||||
continue
|
||||
}
|
||||
|
||||
packages = append(packages,
|
||||
&generator.DefaultPackage{
|
||||
PackageName: filepath.Base(pkg.Path),
|
||||
|
Loading…
Reference in New Issue
Block a user