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
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.
What happened
The
+kubebuilder:*markers onMachine,MachineSetandMachineDeploymentno longer match the CRDs shipped inexamples/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 threecluster.k8s.iotypes failed:That failure has its own cause — the shipped CRDs publish a stub schema (
type: objectplusx-kubernetes-preserve-unknown-fields: true, noproperties), soexplainhas nothing to resolve past the root:examples/machine-controller.yamlexplain .specmachines.cluster.k8s.iofield "spec" does not existmachinesets.cluster.k8s.iofield "spec" does not existmachinedeployments.cluster.k8s.iofield "spec" does not existPublishing 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 getoutput.