From 7b8b033da8528b7214515e575ae46e322b1ffa3c Mon Sep 17 00:00:00 2001 From: Pankti Shah Date: Tue, 5 Dec 2023 13:09:42 -0800 Subject: [PATCH] Check for k8s version in the Cloudstack template name --- pkg/providers/cloudstack/controlplane_test.go | 2 +- .../testdata/cluster_main_with_cp_node_labels.yaml | 6 +++--- .../cloudstack/testdata/cluster_main_with_node_labels.yaml | 6 +++--- .../testdata/expected_results_main_autoscaling_md.yaml | 2 +- .../cloudstack/testdata/expected_results_main_cp.yaml | 4 ++-- .../cloudstack/testdata/expected_results_main_md.yaml | 2 +- .../expected_results_main_no_machinetemplate_update_cp.yaml | 4 ++-- .../expected_results_main_no_machinetemplate_update_md.yaml | 2 +- .../testdata/expected_results_main_node_labels_cp.yaml | 4 ++-- .../testdata/expected_results_main_node_labels_md.yaml | 2 +- .../testdata/expected_results_resourceids_cp.yaml | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkg/providers/cloudstack/controlplane_test.go b/pkg/providers/cloudstack/controlplane_test.go index 78d2bdfa111fc..13c9b629bb70f 100644 --- a/pkg/providers/cloudstack/controlplane_test.go +++ b/pkg/providers/cloudstack/controlplane_test.go @@ -607,7 +607,7 @@ func cloudstackMachineTemplate(name string) *cloudstackv1.CloudStackMachineTempl Template: cloudstackv1.CloudStackMachineTemplateResource{ Spec: cloudstackv1.CloudStackMachineSpec{ Template: cloudstackv1.CloudStackResourceIdentifier{ - Name: "centos7-k8s-118", + Name: "kubernetes_1_21", }, Offering: cloudstackv1.CloudStackResourceIdentifier{ Name: "m4-large", diff --git a/pkg/providers/cloudstack/testdata/cluster_main_with_cp_node_labels.yaml b/pkg/providers/cloudstack/testdata/cluster_main_with_cp_node_labels.yaml index aa9d214b73ab5..9b10683fbc9cd 100644 --- a/pkg/providers/cloudstack/testdata/cluster_main_with_cp_node_labels.yaml +++ b/pkg/providers/cloudstack/testdata/cluster_main_with_cp_node_labels.yaml @@ -64,7 +64,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" @@ -87,7 +87,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" @@ -115,7 +115,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" diff --git a/pkg/providers/cloudstack/testdata/cluster_main_with_node_labels.yaml b/pkg/providers/cloudstack/testdata/cluster_main_with_node_labels.yaml index 44e0acb298dc8..e4b04a2b6edb4 100644 --- a/pkg/providers/cloudstack/testdata/cluster_main_with_node_labels.yaml +++ b/pkg/providers/cloudstack/testdata/cluster_main_with_node_labels.yaml @@ -64,7 +64,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" @@ -89,7 +89,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" @@ -114,7 +114,7 @@ spec: sshAuthorizedKeys: # The key below was manually generated and not used in any production systems - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" template: - name: "centos7-k8s-118" + name: "kubernetes_1_21" diskOffering: name: "Small" mountPath: "/data-small" diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml index 2dcf5cc5f7018..a4c30a6cd0469 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml @@ -124,7 +124,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_cp.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_cp.yaml index 4966a3b79541a..86f3338ebd378 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_cp.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_cp.yaml @@ -453,7 +453,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 @@ -484,6 +484,6 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_md.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_md.yaml index ee8e536461a80..2dd502dc8dad9 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_md.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_md.yaml @@ -121,7 +121,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_cp.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_cp.yaml index c41c84c4d9c5e..a785f4077ce95 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_cp.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_cp.yaml @@ -453,7 +453,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 @@ -484,6 +484,6 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_md.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_md.yaml index 28016d6d5d05a..bc0ddda31c117 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_md.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_no_machinetemplate_update_md.yaml @@ -121,7 +121,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_cp.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_cp.yaml index 94eab6372fee8..2686ccbd064a5 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_cp.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_cp.yaml @@ -439,7 +439,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 @@ -469,6 +469,6 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_md.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_md.yaml index e15084a54bdc1..62855c097298e 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_md.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_node_labels_md.yaml @@ -107,7 +107,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- diff --git a/pkg/providers/cloudstack/testdata/expected_results_resourceids_cp.yaml b/pkg/providers/cloudstack/testdata/expected_results_resourceids_cp.yaml index 36b73fdd41e2a..f1e7feb7ffa48 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_resourceids_cp.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_resourceids_cp.yaml @@ -453,7 +453,7 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 @@ -484,6 +484,6 @@ spec: name: m4-large sshKey: "" template: - name: centos7-k8s-118 + name: kubernetes_1_21 ---