Skip to content

Commit ed835d6

Browse files
committed
Make KCP nodeDrainTimeout mutable
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent e33f04d commit ed835d6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error {
140140
{spec, "machineTemplate", "metadata", "*"},
141141
{spec, "machineTemplate", "infrastructureRef", "apiVersion"},
142142
{spec, "machineTemplate", "infrastructureRef", "name"},
143+
{spec, "machineTemplate", "nodeDrainTimeout"},
143144
{spec, "replicas"},
144145
{spec, "version"},
145146
{spec, "rolloutAfter"},
146-
{spec, "nodeDrainTimeout"},
147147
{spec, "rolloutStrategy", "*"},
148148
}
149149

controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
210210
Namespace: "foo",
211211
Name: "infraTemplate",
212212
},
213+
NodeDrainTimeout: &metav1.Duration{Duration: time.Second},
213214
},
214215
Replicas: pointer.Int32Ptr(1),
215216
RolloutStrategy: &RolloutStrategy{
@@ -329,6 +330,7 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
329330
}
330331
validUpdate.Spec.MachineTemplate.InfrastructureRef.APIVersion = "test/v1alpha2"
331332
validUpdate.Spec.MachineTemplate.InfrastructureRef.Name = "orange"
333+
validUpdate.Spec.MachineTemplate.NodeDrainTimeout = &metav1.Duration{Duration: 10 * time.Second}
332334
validUpdate.Spec.Replicas = pointer.Int32Ptr(5)
333335
now := metav1.NewTime(time.Now())
334336
validUpdate.Spec.RolloutAfter = &now

0 commit comments

Comments
 (0)