Skip to content

Commit 1cf8729

Browse files
committed
Fix review findings
1 parent 03e02f3 commit 1cf8729

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ type KubeadmControlPlaneMachineTemplate struct {
484484

485485
// spec defines the spec for Machines
486486
// in a KubeadmControlPlane object.
487-
// +optional
487+
// +required
488488
Spec KubeadmControlPlaneMachineTemplateSpec `json:"spec,omitempty,omitzero"`
489489
}
490490

api/controlplane/kubeadm/v1beta2/kubeadmcontrolplanetemplate_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ type KubeadmControlPlaneTemplateResourceSpec struct {
130130
// omits ObjectMeta and InfrastructureRef fields. These fields do not make sense on the KubeadmControlPlaneTemplate,
131131
// because they are calculated by the Cluster topology reconciler during reconciliation and thus cannot
132132
// be configured on the KubeadmControlPlaneTemplate.
133+
// +kubebuilder:validation:MinProperties=1
133134
type KubeadmControlPlaneTemplateMachineTemplate struct {
134135
// metadata is the standard object's metadata.
135136
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
@@ -144,6 +145,7 @@ type KubeadmControlPlaneTemplateMachineTemplate struct {
144145

145146
// KubeadmControlPlaneTemplateMachineTemplateSpec defines the spec for Machines
146147
// in a KubeadmControlPlane object.
148+
// +kubebuilder:validation:MinProperties=1
147149
type KubeadmControlPlaneTemplateMachineTemplateSpec struct {
148150
// deletion contains configuration options for Machine deletion.
149151
// +optional

controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controlplane/kubeadm/internal/webhooks/kubeadm_control_plane.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,8 @@ func (webhook *KubeadmControlPlane) ValidateUpdate(_ context.Context, oldObj, ne
215215
// spec.machineTemplate
216216
{spec, "machineTemplate", "metadata"},
217217
{spec, "machineTemplate", "metadata", "*"},
218-
{spec, "machineTemplate", "spec", "infrastructureRef", "apiGroup"},
219-
{spec, "machineTemplate", "spec", "infrastructureRef", "name"},
220-
{spec, "machineTemplate", "spec", "infrastructureRef", "kind"},
221-
{spec, "machineTemplate", "spec", "deletion", "nodeDrainTimeoutSeconds"},
222-
{spec, "machineTemplate", "spec", "deletion", "nodeVolumeDetachTimeoutSeconds"},
223-
{spec, "machineTemplate", "spec", "deletion", "nodeDeletionTimeoutSeconds"},
218+
{spec, "machineTemplate", "spec"},
219+
{spec, "machineTemplate", "spec", "*"},
224220
// spec
225221
{spec, "replicas"},
226222
{spec, "version"},

0 commit comments

Comments
 (0)