From 004ecfa485c1bf32cc75f6032f40816be35a58e1 Mon Sep 17 00:00:00 2001 From: Sedef Date: Mon, 9 Mar 2020 04:22:09 -0700 Subject: [PATCH] allow kcp spec version changes --- .../kubeadm/api/v1alpha3/kubeadm_control_plane_webhook.go | 1 + .../kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook.go index ba709020d84e..ea2a5da88824 100644 --- a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook.go @@ -77,6 +77,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"}, {spec, "infrastructureTemplate", "name"}, {spec, "replicas"}, + {spec, "version"}, } allErrs := in.validateCommon() diff --git a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go index 1634936ad9f0..cabef3f176f2 100644 --- a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_webhook_test.go @@ -612,6 +612,7 @@ func TestPaths(t *testing.T) { diff: map[string]interface{}{ "spec": map[string]interface{}{ "replicas": 4, + "version": "1.17.3", "kubeadmConfigSpec": map[string]interface{}{ "clusterConfiguration": map[string]interface{}{ "version": "v2.0.1", @@ -625,6 +626,7 @@ func TestPaths(t *testing.T) { }, expected: [][]string{ {"spec", "replicas"}, + {"spec", "version"}, {"spec", "kubeadmConfigSpec", "joinConfiguration"}, {"spec", "kubeadmConfigSpec", "clusterConfiguration", "version"}, {"spec", "kubeadmConfigSpec", "initConfiguration", "bootstrapToken"},