Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Added nodeVolumeDetachTimeout to CP machine #8066

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions controlplane/kubeadm/internal/controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,12 @@ func (r *KubeadmControlPlaneReconciler) generateMachine(ctx context.Context, kcp
Bootstrap: clusterv1.Bootstrap{
ConfigRef: bootstrapRef,
},
FailureDomain: failureDomain,
NodeDrainTimeout: kcp.Spec.MachineTemplate.NodeDrainTimeout,
FailureDomain: failureDomain,
NodeDrainTimeout: kcp.Spec.MachineTemplate.NodeDrainTimeout,
NodeDeletionTimeout: kcp.Spec.MachineTemplate.NodeDeletionTimeout,
NodeVolumeDetachTimeout: kcp.Spec.MachineTemplate.NodeVolumeDetachTimeout,
sbueringer marked this conversation as resolved.
Show resolved Hide resolved
},
}
if kcp.Spec.MachineTemplate.NodeDeletionTimeout != nil {
machine.Spec.NodeDeletionTimeout = kcp.Spec.MachineTemplate.NodeDeletionTimeout
}

// Machine's bootstrap config may be missing ClusterConfiguration if it is not the first machine in the control plane.
// We store ClusterConfiguration as annotation here to detect any changes in KCP ClusterConfiguration and rollout the machine if any.
Expand Down
11 changes: 9 additions & 2 deletions controlplane/kubeadm/internal/controllers/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package controllers

import (
"testing"
"time"

. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -515,7 +516,10 @@ func TestKubeadmControlPlaneReconciler_generateMachine(t *testing.T) {
Spec: controlplanev1.KubeadmControlPlaneSpec{
Version: "v1.16.6",
MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
ObjectMeta: kcpMachineTemplateObjectMeta,
ObjectMeta: kcpMachineTemplateObjectMeta,
NodeVolumeDetachTimeout: &metav1.Duration{Duration: 10 * time.Second},
NodeDeletionTimeout: &metav1.Duration{Duration: 10 * time.Second},
NodeDrainTimeout: &metav1.Duration{Duration: 10 * time.Second},
},
},
}
Expand All @@ -538,7 +542,10 @@ func TestKubeadmControlPlaneReconciler_generateMachine(t *testing.T) {
Bootstrap: clusterv1.Bootstrap{
ConfigRef: bootstrapRef.DeepCopy(),
},
InfrastructureRef: *infraRef.DeepCopy(),
InfrastructureRef: *infraRef.DeepCopy(),
NodeVolumeDetachTimeout: &metav1.Duration{Duration: 10 * time.Second},
NodeDeletionTimeout: &metav1.Duration{Duration: 10 * time.Second},
NodeDrainTimeout: &metav1.Duration{Duration: 10 * time.Second},
}
r := &KubeadmControlPlaneReconciler{
Client: fakeClient,
Expand Down