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
{{ message }}
Repository navigation
fix(k8s): CRD-generated classes have no metadata when the schema declares only spec #1309
parseCRDSpec derives the constructor surface from the CRD's openAPIV3Schema properties, skipping apiVersion/kind/status. Whatever is left becomes the class's props.
A CRD's schema describes what its controller reads, so authors routinely declare only spec and status. The Fabric8 CRDGenerator emits exactly that, and so do most hand-written CRDs. cert-manager happens to declare metadata: { type: object }, which is why K8s::CertManager::Certificate has a metadata prop and nothing caught this.
All five KubeMicroVM CRDs added in #1306 are Fabric8-generated. The result:
The serializer emits the metadata correctly — this is a typing gap only, but it defeats the point of generating classes at all, since the one field every object has is the one that needs the cast.
Fix
Emit metadata: ObjectMeta unconditionally for every CRD-generated resource, and skip any schema-declared metadata so it cannot duplicate. The API server accepts full ObjectMeta on a custom resource whatever the CRD schema says about it, so the schema is the wrong authority for this one property.
Acceptance
new MicroVM({ metadata: { name, namespace }, spec }) type-checks with no cast
A CRD whose schema does declare metadata still gets exactly one metadata prop, typed ObjectMeta rather than Record<string, unknown>
Activity
fix(k8s): a custom resource always has metadata, whatever its schema …