@@ -409,12 +409,12 @@ type MachineDeploymentClass struct {
409409 // bootstrap contains the bootstrap template reference to be used
410410 // for the creation of worker Machines.
411411 // +required
412- Bootstrap MachineDeploymentClassBootstrapTemplate `json:"bootstrap"`
412+ Bootstrap MachineDeploymentClassBootstrapTemplate `json:"bootstrap,omitempty,omitzero "`
413413
414414 // infrastructure contains the infrastructure template reference to be used
415415 // for the creation of worker Machines.
416416 // +required
417- Infrastructure MachineDeploymentClassInfrastructureTemplate `json:"infrastructure"`
417+ Infrastructure MachineDeploymentClassInfrastructureTemplate `json:"infrastructure,omitempty,omitzero "`
418418
419419 // healthCheck defines a MachineHealthCheck for this MachineDeploymentClass.
420420 // +optional
@@ -714,12 +714,12 @@ type MachinePoolClass struct {
714714 // bootstrap contains the bootstrap template reference to be used
715715 // for the creation of the Machines in the MachinePool.
716716 // +required
717- Bootstrap MachinePoolClassBootstrapTemplate `json:"bootstrap"`
717+ Bootstrap MachinePoolClassBootstrapTemplate `json:"bootstrap,omitempty,omitzero "`
718718
719719 // infrastructure contains the infrastructure template reference to be used
720720 // for the creation of the MachinePool.
721721 // +required
722- Infrastructure MachinePoolClassInfrastructureTemplate `json:"infrastructure"`
722+ Infrastructure MachinePoolClassInfrastructureTemplate `json:"infrastructure,omitempty,omitzero "`
723723
724724 // failureDomains is the list of failure domains the MachinePool should be attached to.
725725 // Must match a key in the FailureDomains map stored on the cluster object.
@@ -820,7 +820,7 @@ type ClusterClassVariable struct {
820820
821821 // schema defines the schema of the variable.
822822 // +required
823- Schema VariableSchema `json:"schema"`
823+ Schema VariableSchema `json:"schema,omitempty,omitzero "`
824824}
825825
826826// ClusterClassVariableMetadata is the metadata of a variable.
@@ -848,7 +848,7 @@ type VariableSchema struct {
848848 // schema. The schema is a subset of the schema used in
849849 // Kubernetes CRDs.
850850 // +required
851- OpenAPIV3Schema JSONSchemaProps `json:"openAPIV3Schema"`
851+ OpenAPIV3Schema JSONSchemaProps `json:"openAPIV3Schema,omitempty,omitzero "`
852852}
853853
854854// Adapted from https://github.com/kubernetes/apiextensions-apiserver/blob/v0.28.5/pkg/apis/apiextensions/v1/types_jsonschema.go#L40
@@ -1244,15 +1244,16 @@ type ClusterClassPatch struct {
12441244type PatchDefinition struct {
12451245 // selector defines on which templates the patch should be applied.
12461246 // +required
1247- Selector PatchSelector `json:"selector"`
1247+ Selector PatchSelector `json:"selector,omitempty,omitzero "`
12481248
12491249 // jsonPatches defines the patches which should be applied on the templates
12501250 // matching the selector.
12511251 // Note: Patches will be applied in the order of the array.
1252+ // +kubebuilder:validation:MinItems=1
12521253 // +kubebuilder:validation:MaxItems=100
12531254 // +required
12541255 // +listType=atomic
1255- JSONPatches []JSONPatch `json:"jsonPatches"`
1256+ JSONPatches []JSONPatch `json:"jsonPatches,omitempty "`
12561257}
12571258
12581259// PatchSelector defines on which templates the patch should be applied.
@@ -1586,7 +1587,7 @@ type ClusterClassStatusVariableDefinition struct {
15861587
15871588 // schema defines the schema of the variable.
15881589 // +required
1589- Schema VariableSchema `json:"schema"`
1590+ Schema VariableSchema `json:"schema,omitempty,omitzero "`
15901591}
15911592
15921593// GetV1Beta1Conditions returns the set of conditions for this object.
0 commit comments