Skip to content

Commit 549c421

Browse files
committed
Avoid KCP rollouts if only timeouts are changed
Signed-off-by: Stefan Büringer [email protected]
1 parent 79d030a commit 549c421

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

controlplane/kubeadm/internal/filters.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ func matchInitOrJoinConfiguration(machineConfig *bootstrapv1.KubeadmConfig, kcp
316316
}
317317
machineConfig = machineConfig.DeepCopy()
318318

319+
// Cleanup Timeouts, because those info are relevant only for
320+
// the join process and not for comparing the configuration of the machine.
321+
// Note: Changes to Timeouts will apply for the next join, but they will not lead to a rollout
322+
machineConfig.Spec.InitConfiguration.Timeouts = bootstrapv1.Timeouts{}
323+
machineConfig.Spec.JoinConfiguration.Timeouts = bootstrapv1.Timeouts{}
324+
319325
// takes the KubeadmConfigSpec from KCP and applies the transformations required
320326
// to allow a comparison with the KubeadmConfig referenced from the machine.
321327
kcpConfig := getAdjustedKcpConfig(kcp, machineConfig)
@@ -344,6 +350,9 @@ func matchInitOrJoinConfiguration(machineConfig *bootstrapv1.KubeadmConfig, kcp
344350
func getAdjustedKcpConfig(kcp *controlplanev1.KubeadmControlPlane, machineConfig *bootstrapv1.KubeadmConfig) *bootstrapv1.KubeadmConfigSpec {
345351
kcpConfig := kcp.Spec.KubeadmConfigSpec.DeepCopy()
346352

353+
kcpConfig.InitConfiguration.Timeouts = bootstrapv1.Timeouts{}
354+
kcpConfig.JoinConfiguration.Timeouts = bootstrapv1.Timeouts{}
355+
347356
// if Machine's JoinConfiguration is set, this is a joining control plane machine, so empty out the InitConfiguration;
348357
// otherwise empty out the JoinConfiguration.
349358
// Note: a KubeadmConfig for a joining control plane must have at least joinConfiguration.controlPlane and joinConfiguration.discovery to be set for joining;

test/e2e/clusterctl_upgrade_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.9=>cur
275275
})
276276

277277
// Note: This test should be changed during "prepare main branch", it should test n-1 => current.
278-
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.10=>current) [ClusterClass]", Label("ClusterClass"), func() {
278+
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.10=>current) [ClusterClass]", Label("ClusterClass", "PR-Blocking"), func() {
279279
// Get n-1 latest stable release
280280
version := "1.10"
281281
stableRelease, err := GetStableReleaseOfMinor(ctx, version)
@@ -310,7 +310,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.10=>cu
310310
})
311311

312312
// Note: This test should be changed during "prepare main branch", it should test n-1 => current.
313-
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.10=>current) on K8S latest ci mgmt cluster [ClusterClass]", Label("ClusterClass"), func() {
313+
var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.10=>current) on K8S latest ci mgmt cluster [ClusterClass]", Label("ClusterClass", "PR-Blocking"), func() {
314314
// Get n-1 latest stable release
315315
version := "1.10"
316316
stableRelease, err := GetStableReleaseOfMinor(ctx, version)

test/e2e/data/infrastructure-docker/v1.10/clusterclass-quick-start.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ spec:
554554
apiServer:
555555
extraArgs:
556556
v: "0"
557+
timeoutForControlPlane: 4m
557558
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
558559
certSANs: [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"]
559560
initConfiguration:

0 commit comments

Comments
 (0)