Skip to content

Commit df49c85

Browse files
authored
Merge pull request #9170 from MaxFedotov/kcp_webhook_retryjoin
🐛 Allow to drop useExperimentalRetryJoin field from KubeadmControlPlane.kubeadmConfigSpec
2 parents b8f5d06 + b482d48 commit df49c85

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War
140140
// For example, {"spec", "*"} will allow any path under "spec" to change.
141141
allowedPaths := [][]string{
142142
{"metadata", "*"},
143+
{spec, kubeadmConfigSpec, "useExperimentalRetryJoin"},
143144
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"},
144145
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"},
145146
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "extraArgs"},

controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,11 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
698698
"/invalid-key": "foo",
699699
}
700700

701+
beforeUseExperimentalRetryJoin := before.DeepCopy()
702+
beforeUseExperimentalRetryJoin.Spec.KubeadmConfigSpec.UseExperimentalRetryJoin = true //nolint:staticcheck
703+
updateUseExperimentalRetryJoin := before.DeepCopy()
704+
updateUseExperimentalRetryJoin.Spec.KubeadmConfigSpec.UseExperimentalRetryJoin = false //nolint:staticcheck
705+
701706
tests := []struct {
702707
name string
703708
enableIgnitionFeature bool
@@ -1050,6 +1055,12 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
10501055
before: before,
10511056
kcp: invalidMetadata,
10521057
},
1058+
{
1059+
name: "should allow changes to useExperimentalRetryJoin",
1060+
expectErr: false,
1061+
before: beforeUseExperimentalRetryJoin,
1062+
kcp: updateUseExperimentalRetryJoin,
1063+
},
10531064
}
10541065

10551066
for _, tt := range tests {

0 commit comments

Comments
 (0)