You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generator: make generated Go types implement runtime.Object (#143)
Add opt-in generation of controller-gen-style DeepCopy methods, runtime.Object
and schema.ObjectKind methods on root types, and a per-package
groupversion_info.go (GroupVersion/SchemeBuilder/AddToScheme), so generated Go
models can be registered in a runtime.Scheme and used with k8s ecosystem
libraries. This lets users register types instead of setting apiVersion/kind by
hand.
Gated behind a new features.generateGoRuntimeObjects config flag (off by
default), threaded from config through the project build/run and function
generate commands. When enabled, the generated models module additionally
depends on k8s.io/apimachinery (v0.33.0, matching the function go template so a
generated function that consumes the models still builds).
Root types are detected structurally (APIVersion+Kind+Metadata fields). The
runtime.Object pass runs after the k8s type-name fixups so it sees final type
names, and copies known stdlib-backed alias types (Time, MicroTime, FieldsV1,
RawExtension) by value rather than calling DeepCopyInto.
Verified by compile gates that build the generated module (CRD and OpenAPI
paths) plus a behavioral test asserting deep-copy independence for scalar,
slice-of-struct and map fields and AddToScheme GVK round-tripping.
0 commit comments