Skip to content
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
16 changes: 16 additions & 0 deletions controlplane/kubeadm/internal/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,26 @@ func matchInitOrJoinConfiguration(machineConfig *bootstrapv1.KubeadmConfig, kcp
}
machineConfig = machineConfig.DeepCopy()

// Cleanup ControlPlaneComponentHealthCheckSeconds from machineConfig,
// because through conversion apiServer.timeoutForControlPlane in v1beta1 is converted to
// initConfiguration/joinConfiguration.timeouts.controlPlaneComponentHealthCheckSeconds in v1beta2 and
// this can lead to a diff here that would lead to a rollout.
// Note: Changes to ControlPlaneComponentHealthCheckSeconds will apply for the next join, but they will not lead to a rollout.
machineConfig.Spec.InitConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil
machineConfig.Spec.JoinConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil

// takes the KubeadmConfigSpec from KCP and applies the transformations required
// to allow a comparison with the KubeadmConfig referenced from the machine.
kcpConfig := getAdjustedKcpConfig(kcp, machineConfig)

// Cleanup ControlPlaneComponentHealthCheckSeconds from kcpConfig,
// because through conversion apiServer.timeoutForControlPlane in v1beta1 is converted to
// initConfiguration/joinConfiguration.timeouts.controlPlaneComponentHealthCheckSeconds in v1beta2 and
// this can lead to a diff here that would lead to a rollout.
// Note: Changes to ControlPlaneComponentHealthCheckSeconds will apply for the next join, but they will not lead to a rollout.
kcpConfig.InitConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil
kcpConfig.JoinConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil

// Default both KubeadmConfigSpecs before comparison.
// *Note* This assumes that newly added default values never
// introduce a semantic difference to the unset value.
Expand Down
12 changes: 10 additions & 2 deletions controlplane/kubeadm/internal/filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,11 @@ func TestMatchesKubeadmBootstrapConfig(t *testing.T) {
KubeadmConfigSpec: bootstrapv1.KubeadmConfigSpec{
ClusterConfiguration: bootstrapv1.ClusterConfiguration{},
InitConfiguration: bootstrapv1.InitConfiguration{},
JoinConfiguration: bootstrapv1.JoinConfiguration{},
JoinConfiguration: bootstrapv1.JoinConfiguration{
Timeouts: bootstrapv1.Timeouts{
ControlPlaneComponentHealthCheckSeconds: ptr.To[int32](1),
},
},
},
},
}
Expand Down Expand Up @@ -1161,7 +1165,11 @@ func TestMatchesKubeadmBootstrapConfig(t *testing.T) {
Name: "test",
},
Spec: bootstrapv1.KubeadmConfigSpec{
JoinConfiguration: bootstrapv1.JoinConfiguration{},
JoinConfiguration: bootstrapv1.JoinConfiguration{
Timeouts: bootstrapv1.Timeouts{
ControlPlaneComponentHealthCheckSeconds: ptr.To[int32](2),
},
},
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ spec:
apiServer:
extraArgs:
v: "0"
timeoutForControlPlane: 4m
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
certSANs: [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"]
initConfiguration:
Expand Down
Loading