Skip to content

Commit

Permalink
Merge pull request #9202 from MaxFedotov/release-1.5-kcp-drop-useExpe…
Browse files Browse the repository at this point in the history
…rimentalRetryJoin

[release-1.5] 🐛 Allow unsetting useExperimentalRetryJoin field from KubeadmControlPlane
  • Loading branch information
k8s-ci-robot authored Aug 16, 2023
2 parents 2f82e20 + c1f3d78 commit f985687
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War
// For example, {"spec", "*"} will allow any path under "spec" to change.
allowedPaths := [][]string{
{"metadata", "*"},
{spec, kubeadmConfigSpec, "useExperimentalRetryJoin"},
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"},
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"},
{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "extraArgs"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,11 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
{"/var/lib/testdir", "/var/lib/etcd/data"},
}

beforeUseExperimentalRetryJoin := before.DeepCopy()
beforeUseExperimentalRetryJoin.Spec.KubeadmConfigSpec.UseExperimentalRetryJoin = true //nolint:staticcheck
updateUseExperimentalRetryJoin := before.DeepCopy()
updateUseExperimentalRetryJoin.Spec.KubeadmConfigSpec.UseExperimentalRetryJoin = false //nolint:staticcheck

tests := []struct {
name string
enableIgnitionFeature bool
Expand Down Expand Up @@ -1016,6 +1021,12 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
before: before,
kcp: switchFromCloudInitToIgnition,
},
{
name: "should allow changes to useExperimentalRetryJoin",
expectErr: false,
before: beforeUseExperimentalRetryJoin,
kcp: updateUseExperimentalRetryJoin,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit f985687

Please sign in to comment.