mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
kubernetes version: rename latest -> default
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
d995558ffd
commit
57e77ee53f
@ -28,11 +28,11 @@ func TestInitConfiguration(t *testing.T) {
|
|||||||
config KubeadmInitYAML
|
config KubeadmInitYAML
|
||||||
}{
|
}{
|
||||||
"CoreOS init config can be created": {
|
"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": {
|
"CoreOS init config with all fields can be created": {
|
||||||
config: func() KubeadmInitYAML {
|
config: func() KubeadmInitYAML {
|
||||||
c := coreOSConfig.InitConfiguration(true, versions.Latest)
|
c := coreOSConfig.InitConfiguration(true, versions.Default)
|
||||||
c.SetAPIServerAdvertiseAddress("192.0.2.0")
|
c.SetAPIServerAdvertiseAddress("192.0.2.0")
|
||||||
c.SetNodeIP("192.0.2.0")
|
c.SetNodeIP("192.0.2.0")
|
||||||
c.SetNodeName("node")
|
c.SetNodeName("node")
|
||||||
@ -68,8 +68,8 @@ func TestInitConfigurationKubeadmCompatibility(t *testing.T) {
|
|||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"Kubeadm accepts version 'Latest'": {
|
"Kubeadm accepts version 'Latest'": {
|
||||||
config: coreOSConfig.InitConfiguration(true, versions.Latest),
|
config: coreOSConfig.InitConfiguration(true, versions.Default),
|
||||||
expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Latest].PatchVersion),
|
expectedVersion: fmt.Sprintf("v%s", versions.VersionConfigs[versions.Default].PatchVersion),
|
||||||
},
|
},
|
||||||
"Kubeadm receives incompatible version": {
|
"Kubeadm receives incompatible version": {
|
||||||
config: coreOSConfig.InitConfiguration(true, "1.19"),
|
config: coreOSConfig.InitConfiguration(true, "1.19"),
|
||||||
|
@ -79,7 +79,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
},
|
},
|
||||||
ClusterConfiguration: kubeadm.ClusterConfiguration{},
|
ClusterConfiguration: kubeadm.ClusterConfiguration{},
|
||||||
},
|
},
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init works with metadata and loadbalancer": {
|
"kubeadm init works with metadata and loadbalancer": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -119,7 +119,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when retrieving metadata self": {
|
"kubeadm init fails when retrieving metadata self": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -134,7 +134,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when retrieving metadata subnetwork cidr": {
|
"kubeadm init fails when retrieving metadata subnetwork cidr": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -149,7 +149,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when retrieving metadata loadbalancer ip": {
|
"kubeadm init fails when retrieving metadata loadbalancer ip": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -165,7 +165,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when applying the init config": {
|
"kubeadm init fails when applying the init config": {
|
||||||
clusterUtil: stubClusterUtil{initClusterErr: someErr},
|
clusterUtil: stubClusterUtil{initClusterErr: someErr},
|
||||||
@ -177,7 +177,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when deploying helm charts": {
|
"kubeadm init fails when deploying helm charts": {
|
||||||
clusterUtil: stubClusterUtil{setupHelmDeploymentsErr: someErr},
|
clusterUtil: stubClusterUtil{setupHelmDeploymentsErr: someErr},
|
||||||
@ -189,7 +189,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting up the join service": {
|
"kubeadm init fails when setting up the join service": {
|
||||||
clusterUtil: stubClusterUtil{setupJoinServiceError: someErr},
|
clusterUtil: stubClusterUtil{setupJoinServiceError: someErr},
|
||||||
@ -201,7 +201,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting the cloud contoller manager": {
|
"kubeadm init fails when setting the cloud contoller manager": {
|
||||||
clusterUtil: stubClusterUtil{setupCloudControllerManagerError: someErr},
|
clusterUtil: stubClusterUtil{setupCloudControllerManagerError: someErr},
|
||||||
@ -213,7 +213,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting the cloud node manager": {
|
"kubeadm init fails when setting the cloud node manager": {
|
||||||
clusterUtil: stubClusterUtil{setupCloudNodeManagerError: someErr},
|
clusterUtil: stubClusterUtil{setupCloudNodeManagerError: someErr},
|
||||||
@ -225,7 +225,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{SupportedResp: true},
|
CloudNodeManager: &stubCloudNodeManager{SupportedResp: true},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting the cluster autoscaler": {
|
"kubeadm init fails when setting the cluster autoscaler": {
|
||||||
clusterUtil: stubClusterUtil{setupAutoscalingError: someErr},
|
clusterUtil: stubClusterUtil{setupAutoscalingError: someErr},
|
||||||
@ -237,7 +237,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{SupportedResp: true},
|
ClusterAutoscaler: &stubClusterAutoscaler{SupportedResp: true},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when reading kubeconfig": {
|
"kubeadm init fails when reading kubeconfig": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -249,7 +249,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{},
|
CloudNodeManager: &stubCloudNodeManager{},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting up the kms": {
|
"kubeadm init fails when setting up the kms": {
|
||||||
clusterUtil: stubClusterUtil{setupKMSError: someErr},
|
clusterUtil: stubClusterUtil{setupKMSError: someErr},
|
||||||
@ -261,7 +261,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{SupportedResp: false},
|
CloudNodeManager: &stubCloudNodeManager{SupportedResp: false},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"kubeadm init fails when setting up verification service": {
|
"kubeadm init fails when setting up verification service": {
|
||||||
clusterUtil: stubClusterUtil{setupVerificationServiceErr: someErr},
|
clusterUtil: stubClusterUtil{setupVerificationServiceErr: someErr},
|
||||||
@ -273,7 +273,7 @@ func TestInitCluster(t *testing.T) {
|
|||||||
CloudNodeManager: &stubCloudNodeManager{SupportedResp: false},
|
CloudNodeManager: &stubCloudNodeManager{SupportedResp: false},
|
||||||
ClusterAutoscaler: &stubClusterAutoscaler{},
|
ClusterAutoscaler: &stubClusterAutoscaler{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
k8sVersion: versions.Latest,
|
k8sVersion: versions.Default,
|
||||||
},
|
},
|
||||||
"unsupported k8sVersion fails cluster creation": {
|
"unsupported k8sVersion fails cluster creation": {
|
||||||
clusterUtil: stubClusterUtil{},
|
clusterUtil: stubClusterUtil{},
|
||||||
@ -334,7 +334,7 @@ func TestJoinCluster(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
privateIP := "192.0.2.1"
|
privateIP := "192.0.2.1"
|
||||||
k8sVersion := versions.Latest
|
k8sVersion := versions.Default
|
||||||
|
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
clusterUtil stubClusterUtil
|
clusterUtil stubClusterUtil
|
||||||
|
@ -95,7 +95,7 @@ func TestTrivialCCMFunctions(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
cloud := CloudControllerManager{}
|
cloud := CloudControllerManager{}
|
||||||
|
|
||||||
assert.NotEmpty(cloud.Image(versions.Latest))
|
assert.NotEmpty(cloud.Image(versions.Default))
|
||||||
assert.NotEmpty(cloud.Path())
|
assert.NotEmpty(cloud.Path())
|
||||||
assert.NotEmpty(cloud.Name())
|
assert.NotEmpty(cloud.Name())
|
||||||
assert.NotEmpty(cloud.ExtraArgs())
|
assert.NotEmpty(cloud.ExtraArgs())
|
||||||
|
@ -17,7 +17,7 @@ func TestTrivialCNMFunctions(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
cloud := CloudNodeManager{}
|
cloud := CloudNodeManager{}
|
||||||
|
|
||||||
assert.NotEmpty(cloud.Image(versions.Latest))
|
assert.NotEmpty(cloud.Image(versions.Default))
|
||||||
assert.NotEmpty(cloud.Path())
|
assert.NotEmpty(cloud.Path())
|
||||||
assert.NotEmpty(cloud.ExtraArgs())
|
assert.NotEmpty(cloud.ExtraArgs())
|
||||||
assert.True(cloud.Supported())
|
assert.True(cloud.Supported())
|
||||||
|
@ -139,7 +139,7 @@ func TestTrivialCCMFunctions(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
cloud := CloudControllerManager{}
|
cloud := CloudControllerManager{}
|
||||||
|
|
||||||
assert.NotEmpty(cloud.Image(versions.Latest))
|
assert.NotEmpty(cloud.Image(versions.Default))
|
||||||
assert.NotEmpty(cloud.Path())
|
assert.NotEmpty(cloud.Path())
|
||||||
assert.NotEmpty(cloud.Name())
|
assert.NotEmpty(cloud.Name())
|
||||||
assert.NotEmpty(cloud.ExtraArgs())
|
assert.NotEmpty(cloud.ExtraArgs())
|
||||||
|
@ -297,7 +297,7 @@ func Default() *Config {
|
|||||||
EnforcedMeasurements: []uint32{11, 12},
|
EnforcedMeasurements: []uint32{11, 12},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
KubernetesVersion: string(versions.Latest),
|
KubernetesVersion: string(versions.Default),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ const (
|
|||||||
NodeMaintenanceOperatorVersion = "v0.13.1-alpha1"
|
NodeMaintenanceOperatorVersion = "v0.13.1-alpha1"
|
||||||
|
|
||||||
// currently supported versions.
|
// currently supported versions.
|
||||||
V1_22 ValidK8sVersion = "1.22"
|
V1_22 ValidK8sVersion = "1.22"
|
||||||
V1_23 ValidK8sVersion = "1.23"
|
V1_23 ValidK8sVersion = "1.23"
|
||||||
V1_24 ValidK8sVersion = "1.24"
|
V1_24 ValidK8sVersion = "1.24"
|
||||||
Latest ValidK8sVersion = V1_24
|
Default ValidK8sVersion = V1_24
|
||||||
)
|
)
|
||||||
|
|
||||||
// versionConfigs holds download URLs for all required kubernetes components for every supported version.
|
// versionConfigs holds download URLs for all required kubernetes components for every supported version.
|
||||||
|
@ -42,7 +42,7 @@ func TestIssueJoinTicket(t *testing.T) {
|
|||||||
CACertHashes: []string{"hash"},
|
CACertHashes: []string{"hash"},
|
||||||
Token: "token",
|
Token: "token",
|
||||||
}
|
}
|
||||||
testK8sVersion := versions.Latest
|
testK8sVersion := versions.Default
|
||||||
|
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
isControlPlane bool
|
isControlPlane bool
|
||||||
|
Loading…
Reference in New Issue
Block a user