Skip to content

Commit

Permalink
Allow to drop useExperimentalRetryJoin field from KubeadmControlPlane…
Browse files Browse the repository at this point in the history
….kubeadmConfigSpec
  • Loading branch information
MaxFedotov committed Aug 14, 2023
1 parent ce33c29 commit 9d22852
Show file tree
Hide file tree
Showing 2 changed files with 11 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 @@ -355,6 +355,7 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
Servers: []string{"test-server-1", "test-server-2"},
Enabled: pointer.Bool(true),
},
UseExperimentalRetryJoin: true,
},
Version: "v1.16.6",
RolloutBefore: &RolloutBefore{
Expand Down Expand Up @@ -698,6 +699,9 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
"/invalid-key": "foo",
}

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

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

for _, tt := range tests {
Expand Down

0 comments on commit 9d22852

Please sign in to comment.