diff --git a/bootstrapper/internal/kubernetes/k8sapi/kubeadm_config_test.go b/bootstrapper/internal/kubernetes/k8sapi/kubeadm_config_test.go index 0aaac8326..9048a4234 100644 --- a/bootstrapper/internal/kubernetes/k8sapi/kubeadm_config_test.go +++ b/bootstrapper/internal/kubernetes/k8sapi/kubeadm_config_test.go @@ -28,11 +28,11 @@ func TestInitConfiguration(t *testing.T) { config KubeadmInitYAML }{ "CoreOS init config can be created": { - config: coreOSConfig.InitConfiguration(true, versions.Latest), + config: coreOSConfig.InitConfiguration(true, versions.Default), }, "CoreOS init config with all fields can be created": { config: func() KubeadmInitYAML { - c := coreOSConfig.InitConfiguration(true, versions.Latest) + c := coreOSConfig.InitConfiguration(true, versions.Default) c.SetAPIServerAdvertiseAddress("192.0.2.0") c.SetNodeIP("192.0.2.0") c.SetNodeName("node") @@ -68,8 +68,8 @@ func TestInitConfigurationKubeadmCompatibility(t *testing.T) { wantErr bool }{ "Kubeadm accepts version 'Latest'": { - config: coreOSConfig.InitConfiguration(true, versions.Latest), - expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Latest].PatchVersion), + config: coreOSConfig.InitConfiguration(true, versions.Default), + expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Default].PatchVersion), }, "Kubeadm receives incompatible version": { config: coreOSConfig.InitConfiguration(true, "1.19"), diff --git a/bootstrapper/internal/kubernetes/kubernetes_test.go b/bootstrapper/internal/kubernetes/kubernetes_test.go index cf02753be..73d31013b 100644 --- a/bootstrapper/internal/kubernetes/kubernetes_test.go +++ b/bootstrapper/internal/kubernetes/kubernetes_test.go @@ -79,7 +79,7 @@ func TestInitCluster(t *testing.T) { }, ClusterConfiguration: kubeadm.ClusterConfiguration{}, }, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init works with metadata and loadbalancer": { clusterUtil: stubClusterUtil{}, @@ -119,7 +119,7 @@ func TestInitCluster(t *testing.T) { }, }, wantErr: false, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when retrieving metadata self": { clusterUtil: stubClusterUtil{}, @@ -134,7 +134,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when retrieving metadata subnetwork cidr": { clusterUtil: stubClusterUtil{}, @@ -149,7 +149,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when retrieving metadata loadbalancer ip": { clusterUtil: stubClusterUtil{}, @@ -165,7 +165,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when applying the init config": { clusterUtil: stubClusterUtil{initClusterErr: someErr}, @@ -177,7 +177,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when deploying helm charts": { clusterUtil: stubClusterUtil{setupHelmDeploymentsErr: someErr}, @@ -189,7 +189,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting up the join service": { clusterUtil: stubClusterUtil{setupJoinServiceError: someErr}, @@ -201,7 +201,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting the cloud contoller manager": { clusterUtil: stubClusterUtil{setupCloudControllerManagerError: someErr}, @@ -213,7 +213,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting the cloud node manager": { clusterUtil: stubClusterUtil{setupCloudNodeManagerError: someErr}, @@ -225,7 +225,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{SupportedResp: true}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting the cluster autoscaler": { clusterUtil: stubClusterUtil{setupAutoscalingError: someErr}, @@ -237,7 +237,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{SupportedResp: true}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when reading kubeconfig": { clusterUtil: stubClusterUtil{}, @@ -249,7 +249,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting up the kms": { clusterUtil: stubClusterUtil{setupKMSError: someErr}, @@ -261,7 +261,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{SupportedResp: false}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "kubeadm init fails when setting up verification service": { clusterUtil: stubClusterUtil{setupVerificationServiceErr: someErr}, @@ -273,7 +273,7 @@ func TestInitCluster(t *testing.T) { CloudNodeManager: &stubCloudNodeManager{SupportedResp: false}, ClusterAutoscaler: &stubClusterAutoscaler{}, wantErr: true, - k8sVersion: versions.Latest, + k8sVersion: versions.Default, }, "unsupported k8sVersion fails cluster creation": { clusterUtil: stubClusterUtil{}, @@ -334,7 +334,7 @@ func TestJoinCluster(t *testing.T) { } privateIP := "192.0.2.1" - k8sVersion := versions.Latest + k8sVersion := versions.Default testCases := map[string]struct { clusterUtil stubClusterUtil diff --git a/internal/cloud/azure/ccm_test.go b/internal/cloud/azure/ccm_test.go index e053b7fcb..fdf79a937 100644 --- a/internal/cloud/azure/ccm_test.go +++ b/internal/cloud/azure/ccm_test.go @@ -95,7 +95,7 @@ func TestTrivialCCMFunctions(t *testing.T) { assert := assert.New(t) cloud := CloudControllerManager{} - assert.NotEmpty(cloud.Image(versions.Latest)) + assert.NotEmpty(cloud.Image(versions.Default)) assert.NotEmpty(cloud.Path()) assert.NotEmpty(cloud.Name()) assert.NotEmpty(cloud.ExtraArgs()) diff --git a/internal/cloud/azure/cloudnodemanager_test.go b/internal/cloud/azure/cloudnodemanager_test.go index 06e4be374..fd00fb792 100644 --- a/internal/cloud/azure/cloudnodemanager_test.go +++ b/internal/cloud/azure/cloudnodemanager_test.go @@ -17,7 +17,7 @@ func TestTrivialCNMFunctions(t *testing.T) { assert := assert.New(t) cloud := CloudNodeManager{} - assert.NotEmpty(cloud.Image(versions.Latest)) + assert.NotEmpty(cloud.Image(versions.Default)) assert.NotEmpty(cloud.Path()) assert.NotEmpty(cloud.ExtraArgs()) assert.True(cloud.Supported()) diff --git a/internal/cloud/gcp/ccm_test.go b/internal/cloud/gcp/ccm_test.go index b12425187..6eab75ed6 100644 --- a/internal/cloud/gcp/ccm_test.go +++ b/internal/cloud/gcp/ccm_test.go @@ -139,7 +139,7 @@ func TestTrivialCCMFunctions(t *testing.T) { assert := assert.New(t) cloud := CloudControllerManager{} - assert.NotEmpty(cloud.Image(versions.Latest)) + assert.NotEmpty(cloud.Image(versions.Default)) assert.NotEmpty(cloud.Path()) assert.NotEmpty(cloud.Name()) assert.NotEmpty(cloud.ExtraArgs()) diff --git a/internal/config/config.go b/internal/config/config.go index 539668d0a..07444163a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -297,7 +297,7 @@ func Default() *Config { EnforcedMeasurements: []uint32{11, 12}, }, }, - KubernetesVersion: string(versions.Latest), + KubernetesVersion: string(versions.Default), } } diff --git a/internal/versions/versions.go b/internal/versions/versions.go index b7d9a58db..7b87a8608 100644 --- a/internal/versions/versions.go +++ b/internal/versions/versions.go @@ -49,10 +49,10 @@ const ( NodeMaintenanceOperatorVersion = "v0.13.1-alpha1" // currently supported versions. - V1_22 ValidK8sVersion = "1.22" - V1_23 ValidK8sVersion = "1.23" - V1_24 ValidK8sVersion = "1.24" - Latest ValidK8sVersion = V1_24 + V1_22 ValidK8sVersion = "1.22" + V1_23 ValidK8sVersion = "1.23" + V1_24 ValidK8sVersion = "1.24" + Default ValidK8sVersion = V1_24 ) // versionConfigs holds download URLs for all required kubernetes components for every supported version. diff --git a/joinservice/internal/server/server_test.go b/joinservice/internal/server/server_test.go index 9d4199c38..f3aaa2ba7 100644 --- a/joinservice/internal/server/server_test.go +++ b/joinservice/internal/server/server_test.go @@ -42,7 +42,7 @@ func TestIssueJoinTicket(t *testing.T) { CACertHashes: []string{"hash"}, Token: "token", } - testK8sVersion := versions.Latest + testK8sVersion := versions.Default testCases := map[string]struct { isControlPlane bool