codegen: generate go clients for custom resource routes#1283
Merged
Conversation
IfSentient
approved these changes
Mar 13, 2026
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.
What Changed? Why?
Previously, the SDK only generated Go clients for individual resource kinds
(CRUD operations + kind-level custom routes). However, manifest versions can
also define custom routes at the routes.namespaced and routes.cluster level —
scoped to a Group/Version rather than a specific kind — and no client was
generated for those.
This PR adds codegen support for Group/Version-level custom route clients.
When a manifest version defines routes in routes.namespaced or routes.cluster,
a CustomRouteClient is now generated in the version package (e.g.
pkg/generated/v1alpha1/client_gen.go) with typed methods for each route.
Key Changes
(existing per-kind clients) and generateCustomRouteClients (new GV-level
clients). The new generator iterates over manifest versions and emits a client
file if any namespaced or clustered routes are present.
struct, with typed *Request/*Response wrapper methods for namespaced and
clustered routes. Uses NewCustomRouteClientFromGenerator to construct the
client from a resource.ClientGenerator.
ClusteredRequest) and extended ClientGenerator with
GetCustomRouteClient(schema.GroupVersion, string).
by the existing groupVersionClient.
callers can obtain a CustomRouteClient for any registered GV.
Addresses Issue #1277
How was it tested?