From 06497aa13ce1dcdc6efa383c5a728054a34f2ea9 Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 22 Aug 2022 16:01:55 -0400 Subject: [PATCH] update the apply generator to use the same package the the client generator expects --- .../cmd/applyconfiguration-gen/generators/packages.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go b/staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go index 53bea62fa56..ec716d529be 100644 --- a/staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go +++ b/staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go @@ -30,6 +30,7 @@ import ( "k8s.io/klog/v2" applygenargs "k8s.io/code-generator/cmd/applyconfiguration-gen/args" + "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" ) @@ -236,8 +237,10 @@ func packageTypesForInputDirs(context *generator.Context, inputDirs []string, ou klog.Warningf("Skipping internal package: %s", p.Path) continue } - gv := groupVersion(p) - pkg := filepath.Join(outputPath, gv.Group.PackageName(), strings.ToLower(gv.Version.NonEmpty())) + // this is how the client generator finds the package we are creating. It uses the API package name, not the group name. + _, gvPackageString := util.ParsePathGroupVersion(p.Path) + + pkg := filepath.Join(outputPath, strings.ToLower(gvPackageString)) pkgTypes[pkg] = p } return pkgTypes