Skip to content

Commit

Permalink
Merge pull request #7646 from dntosas/feat/make-skip-phases-mutable-o…
Browse files Browse the repository at this point in the history
…n-kcp

✨ [kcp] Make kcp.skipPhases field mutable
  • Loading branch information
k8s-ci-robot committed Nov 29, 2022
2 parents bae19a2 + 650b187 commit 2e7b8f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const (
initConfiguration = "initConfiguration"
joinConfiguration = "joinConfiguration"
nodeRegistration = "nodeRegistration"
skipPhases = "skipPhases"
patches = "patches"
directory = "directory"
preKubeadmCommands = "preKubeadmCommands"
Expand Down Expand Up @@ -148,8 +149,10 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error {
{spec, kubeadmConfigSpec, clusterConfiguration, scheduler, "*"},
{spec, kubeadmConfigSpec, initConfiguration, nodeRegistration, "*"},
{spec, kubeadmConfigSpec, initConfiguration, patches, directory},
{spec, kubeadmConfigSpec, initConfiguration, skipPhases},
{spec, kubeadmConfigSpec, joinConfiguration, nodeRegistration, "*"},
{spec, kubeadmConfigSpec, joinConfiguration, patches, directory},
{spec, kubeadmConfigSpec, joinConfiguration, skipPhases},
{spec, kubeadmConfigSpec, preKubeadmCommands},
{spec, kubeadmConfigSpec, postKubeadmCommands},
{spec, kubeadmConfigSpec, files},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,12 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
Directory: "/tmp/patches",
}

updateInitConfigurationSkipPhases := before.DeepCopy()
updateInitConfigurationSkipPhases.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases = []string{"addon/kube-proxy"}

updateJoinConfigurationSkipPhases := before.DeepCopy()
updateJoinConfigurationSkipPhases.Spec.KubeadmConfigSpec.JoinConfiguration.SkipPhases = []string{"addon/kube-proxy"}

updateDiskSetup := before.DeepCopy()
updateDiskSetup.Spec.KubeadmConfigSpec.DiskSetup = &bootstrapv1.DiskSetup{
Filesystems: []bootstrapv1.Filesystem{
Expand Down Expand Up @@ -985,6 +991,18 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
before: before,
kcp: updateJoinConfigurationPatches,
},
{
name: "should allow changes to initConfiguration.skipPhases",
expectErr: false,
before: before,
kcp: updateInitConfigurationSkipPhases,
},
{
name: "should allow changes to joinConfiguration.skipPhases",
expectErr: false,
before: before,
kcp: updateJoinConfigurationSkipPhases,
},
{
name: "should allow changes to diskSetup",
expectErr: false,
Expand Down

0 comments on commit 2e7b8f8

Please sign in to comment.