Skip to content

Align kubebuilder markers with shipped CRDs #2091

Description

@KhizerRehan

What happened

The +kubebuilder:* markers on Machine, MachineSet and MachineDeployment no longer match the CRDs shipped in examples/machine-controller.yaml, so a controller-gen run would not be output-neutral.

Found while sweeping every CRD in a live cluster with kubectl explain <crd>.spec. All three cluster.k8s.io types failed:

error: field "spec" does not exist
Image

That failure has its own cause — the shipped CRDs publish a stub schema (type: object plus x-kubernetes-preserve-unknown-fields: true, no properties), so explain has nothing to resolve past the root:

CRD Schema in examples/machine-controller.yaml explain .spec
machines.cluster.k8s.io line 23, stub field "spec" does not exist
machinesets.cluster.k8s.io line 72, stub field "spec" does not exist
machinedeployments.cluster.k8s.io line 126, stub field "spec" does not exist

Publishing a real structural schema is out of scope here and needs its own issue. Auditing the markers to explain the failure is what turned up three mismatches against the shipped CRDs:

Fix: markers follow the shipped YAML. No change to CRD YAML, controller behaviour, or kubectl get output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions