Migrate code generation to kube_codegen.sh, bump to gengo-builder release-1.34 - #672
Merged
Conversation
tamalsaha
force-pushed
the
kube-codegen-migration
branch
from
September 2, 2026 16:58
c06caf3 to
f23724e
Compare
…ease-1.34 Mirrors the same migration already done for kubedb.dev/apimachinery, kubevault.dev/apimachinery, voyagermesh.dev/apimachinery and kubeops.dev/petset: replaces the old generate-groups.sh based clientset target with update-codegen.sh, a generic script bundled into CODE_GENERATOR_IMAGE (see appscodelabs/gengo-builder's scripts/update-codegen.sh for the full env-var interface). GENERATORS is scoped to deepcopy+client only (no lister/informer), matching what the old generate-groups.sh call here actually generated. apis/shared has no client of its own (it's not part of API_GROUPS) but still needs deepcopy, hence EXTRA_DEEPCOPY_PKGS. openapi-shared/ openapi-% are updated for the new openapi-gen CLI (positional packages + --output-dir/--output-pkg/--output-file instead of --input-dirs/ --output-package); their --input-dirs list also drops go.bytebuilders.dev/catalog/api/v1alpha1, an unresolvable reference (no such package is in go.mod/vendor, or imported anywhere under apis/ -- only an unrelated cmd/import-crds tool references a same-named but different package) that the old openapi-gen silently tolerated but the new one hard-fails on. 12 +genclient types across editor/identity/meta (EditorModel, AuditTokenRequest, InboxTokenRequest, ChartPresetQuery, ClusterStatus, Render, RenderDashboard, RenderMenu, RenderRawGraph, ResourceGraph, ResourceManifests, ResourceQuery) are request/response payloads with no metav1.ObjectMeta -- the new gentype-based client-gen would otherwise require adding it (or dropping +genclient) for all 12, same as kubedb.dev/apimachinery's DatabaseSummary needed. Instead, this bumps kmodules.xyz/client-go to pick up its new create-only gentype.Client[T runtime.Object] (kmodules/client-go#646) and the matching kmodules/code-generator client-gen patch that detects this shape (+genclient:onlyVerbs=create with no ObjectMeta) and builds the client on it instead of k8s.io/client-go/gentype's Client[T], which requires metav1.Object -- so none of apis/ needed any changes at all, for any of the 12 types. Verified with make check-license, lint, build, and a full make gen (update-codegen, manifests, openapi) against the real gengo-builder release-1.34 image -- zero apis/ diff, and the only crds/ diff is the newer controller-gen (ac-0.19.0, up from whatever this repo's release-1.32-era CODE_GENERATOR_IMAGE shipped) dropping the null creationTimestamp field CRD YAML used to carry. make unit-tests passes except hub.TestRegister, which needs a live cluster (KUBERNETES_MASTER) that this repo's CI provisions via kind but wasn't available to verify locally -- not something this migration touches. Signed-off-by: Tamal Saha <tamal@appscode.com>
tamalsaha
force-pushed
the
kube-codegen-migration
branch
from
September 2, 2026 18:49
f23724e to
ec8044f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors the same migration already done for kubedb.dev/apimachinery, kubevault.dev/apimachinery, voyagermesh.dev/apimachinery and kubeops.dev/petset: replaces the old
generate-groups.shbasedclientsettarget withupdate-codegen.sh, a generic script bundled intoCODE_GENERATOR_IMAGE(see gengo-builder's scripts/update-codegen.sh for the full env-var interface).GENERATORSis scoped todeepcopy,clientonly (no lister/informer), matching what the oldgenerate-groups.shcall here actually generated.apis/sharedhas no client of its own (it's not part ofAPI_GROUPS) but still needs deepcopy, henceEXTRA_DEEPCOPY_PKGS.openapi-shared/openapi-%are updated for the newopenapi-genCLI (positional packages +--output-dir/--output-pkg/--output-fileinstead of--input-dirs/--output-package); their input list also dropsgo.bytebuilders.dev/catalog/api/v1alpha1, an unresolvable reference (not in go.mod/vendor, not imported anywhere underapis/-- only an unrelatedcmd/import-crdstool references a same-named but different package) that the oldopenapi-gensilently tolerated but the new one hard-fails on.The interesting part
12
+genclienttypes across editor/identity/meta (EditorModel,AuditTokenRequest,InboxTokenRequest,ChartPresetQuery,ClusterStatus,Render,RenderDashboard,RenderMenu,RenderRawGraph,ResourceGraph,ResourceManifests,ResourceQuery) are request/response payloads with nometav1.ObjectMeta-- the new gentype-basedclient-genwould otherwise require adding it (or dropping+genclient) for all 12, the same problemkubedb.dev/apimachinery'sDatabaseSummaryhit (kubedb/apimachinery#1889).Instead of touching any of the 12 types, this bumps
kmodules.xyz/client-goto pick up its new create-onlygentype.Client[T runtime.Object](kmodules/client-go#646) and a matchingkmodules/code-generatorclient-genpatch that detects this exact shape (+genclient:onlyVerbs=createwith noObjectMeta) and builds the client on it instead ofk8s.io/client-go/gentype'sClient[T], which requiresmetav1.Object. Soapis/needed zero changes for any of the 12 types.Verification
Ran locally against the real
ghcr.io/appscode/gengo:release-1.34image:check-license,lint,build, and a fullmake gen(update-codegen, manifests, openapi) -- zeroapis/diff, and the onlycrds/diff is the newercontroller-gen(ac-0.19.0) dropping the nullcreationTimestampfield CRD YAML used to carry.make unit-testspasses excepthub.TestRegister, which needs a live cluster (KUBERNETES_MASTER) that this repo's CI provisions viakindbut wasn't available in my local environment to verify -- not something this migration touches, and CI'sk8sjob will exercise it for real.