Sink two codegen passes below loop. (#2209)

I noticed doing some tinkering that these were running on every iteration, but the inputs don't change.  This sinks the calls to below the loop, and reduces things to a single call for each.
This commit is contained in:
Matt Moore 2021-08-16 15:37:16 -07:00 committed by GitHub
parent 2c8a7b6bd7
commit bf176d5654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -78,12 +78,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
groupGoNames[groupPackageName] = namer.IC(override[0])
}
// Generate the client and fake.
packageList = append(packageList, versionClientsPackages(versionPackagePath, boilerplate, customArgs)...)
// Generate the informer factory and fake.
packageList = append(packageList, versionFactoryPackages(versionPackagePath, boilerplate, customArgs)...)
var typesWithInformers []*types.Type
var duckTypes []*types.Type
var reconcilerTypes []*types.Type
@ -135,6 +129,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
}
}
// Generate the client and fake.
packageList = append(packageList, versionClientsPackages(versionPackagePath, boilerplate, customArgs)...)
// Generate the informer factory and fake.
packageList = append(packageList, versionFactoryPackages(versionPackagePath, boilerplate, customArgs)...)
return packageList
}