diff --git a/validation/certificates/k3s/cert_rotation_test.go b/validation/certificates/k3s/cert_rotation_test.go index ac2ac430d..0f96a8ea8 100644 --- a/validation/certificates/k3s/cert_rotation_test.go +++ b/validation/certificates/k3s/cert_rotation_test.go @@ -8,7 +8,6 @@ import ( "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -74,7 +73,7 @@ func (c *CertRotationTestSuite) SetupSuite() { if rancherConfig.ClusterName == "" { logrus.Info("Provisioning K3S cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.K3S, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/defaults/defaults.yaml b/validation/certificates/k3s/defaults/defaults.yaml similarity index 100% rename from validation/certificates/defaults/defaults.yaml rename to validation/certificates/k3s/defaults/defaults.yaml diff --git a/validation/certificates/k3s/dualstack/cert_rotation_test.go b/validation/certificates/k3s/dualstack/cert_rotation_test.go index baad87df6..e15de4549 100644 --- a/validation/certificates/k3s/dualstack/cert_rotation_test.go +++ b/validation/certificates/k3s/dualstack/cert_rotation_test.go @@ -6,10 +6,8 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -19,7 +17,6 @@ import ( "github.com/rancher/tests/actions/config/defaults" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" - "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" @@ -71,23 +68,12 @@ func (c *CertRotationDualstackTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, c.cattleConfig, rancherConfig) - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true if rancherConfig.ClusterName == "" { provider := provisioning.CreateProvider(clusterConfig.Provider) machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - logrus.Info("Provisioning K3s cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.K3S, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/k3s/ipv6/cert_rotation_test.go b/validation/certificates/k3s/ipv6/cert_rotation_test.go index c78c4fedf..6c157aa4d 100644 --- a/validation/certificates/k3s/ipv6/cert_rotation_test.go +++ b/validation/certificates/k3s/ipv6/cert_rotation_test.go @@ -6,10 +6,8 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -19,7 +17,6 @@ import ( "github.com/rancher/tests/actions/config/defaults" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" - "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" @@ -75,20 +72,8 @@ func (c *CertRotationIPv6TestSuite) SetupSuite() { provider := provisioning.CreateProvider(clusterConfig.Provider) machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - logrus.Info("Provisioning K3s cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.K3S, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/k3s/ipv6/defaults/defaults.yaml b/validation/certificates/k3s/ipv6/defaults/defaults.yaml index 6b75d274e..97d90faee 100644 --- a/validation/certificates/k3s/ipv6/defaults/defaults.yaml +++ b/validation/certificates/k3s/ipv6/defaults/defaults.yaml @@ -4,6 +4,9 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true awsMachineConfigs: awsMachineConfig: diff --git a/validation/certificates/rke2/cert_rotation_test.go b/validation/certificates/rke2/cert_rotation_test.go index 6d992b6b9..a81ec8397 100644 --- a/validation/certificates/rke2/cert_rotation_test.go +++ b/validation/certificates/rke2/cert_rotation_test.go @@ -8,7 +8,6 @@ import ( "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -74,7 +73,7 @@ func (c *CertRotationTestSuite) SetupSuite() { machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) logrus.Info("Provisioning RKE2 cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.RKE2, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/rke2/cert_rotation_wins_test.go b/validation/certificates/rke2/cert_rotation_wins_test.go index acee35dd4..1066bfc1b 100644 --- a/validation/certificates/rke2/cert_rotation_wins_test.go +++ b/validation/certificates/rke2/cert_rotation_wins_test.go @@ -9,7 +9,6 @@ import ( "github.com/rancher/shepherd/clients/ec2" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/providers" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" @@ -98,7 +97,7 @@ func (c *CertRotationWindowsTestSuite) SetupSuite() { machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) logrus.Info("Provisioning RKE2 windows cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, awsEC2Configs, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.RKE2, provider, *clusterConfig, machineConfigSpec, awsEC2Configs, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/rke2/defaults/defaults.yaml b/validation/certificates/rke2/defaults/defaults.yaml new file mode 100644 index 000000000..faec5e516 --- /dev/null +++ b/validation/certificates/rke2/defaults/defaults.yaml @@ -0,0 +1,58 @@ +#Required for all tests +rancher: + host: "" + adminToken: "" + insecure: true + cleanup: true + +#Required for all tests except template +clusterConfig: + machinePools: + - machinePoolConfig: + etcd: true + controlplane: false + worker: false + quantity: 1 + - machinePoolConfig: + etcd: false + controlplane: true + worker: false + quantity: 1 + - machinePoolConfig: + etcd: false + controlplane: false + worker: true + quantity: 1 + kubernetesVersion: "" + cni: "calico" + provider: "aws" + nodeProvider: "ec2" + +#Required for all tests +awsCredentials: + secretKey: "" + accessKey: "" + defaultRegion: "us-east-2" + +#Required for tests that utilize node driver clusters +awsMachineConfigs: + region: "us-east-2" + awsMachineConfig: + - roles: ["etcd","controlplane","worker"] + ami: "" + instanceType: "t3a.medium" + sshUser: "" + vpcId: "" + retries: "5" + - roles: ["windows"] + ami: "" + instanceType: "t2.2xlarge" + sshUser: "" + vpcId: "" + volumeType: "" + zone: "a" + retries: "5" + rootSize: "100" + +logging: + level: "info" \ No newline at end of file diff --git a/validation/certificates/rke2/dualstack/cert_rotation_test.go b/validation/certificates/rke2/dualstack/cert_rotation_test.go index 91860c763..df8afe98c 100644 --- a/validation/certificates/rke2/dualstack/cert_rotation_test.go +++ b/validation/certificates/rke2/dualstack/cert_rotation_test.go @@ -8,7 +8,6 @@ import ( "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -74,7 +73,7 @@ func (c *CertRotationDualstackTestSuite) SetupSuite() { machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) logrus.Info("Provisioning RKE2 cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.RKE2, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/certificates/rke2/ipv6/cert_rotation_test.go b/validation/certificates/rke2/ipv6/cert_rotation_test.go index a2d4da0bc..94ed17202 100644 --- a/validation/certificates/rke2/ipv6/cert_rotation_test.go +++ b/validation/certificates/rke2/ipv6/cert_rotation_test.go @@ -8,7 +8,6 @@ import ( "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" - extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/defaults/stevetypes" "github.com/rancher/shepherd/pkg/config" "github.com/rancher/shepherd/pkg/config/operations" @@ -74,7 +73,7 @@ func (c *CertRotationIPv6TestSuite) SetupSuite() { machineConfigSpec := provider.LoadMachineConfigFunc(c.cattleConfig) logrus.Info("Provisioning RKE2 cluster") - c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) + c.cluster, err = resources.ProvisionRKE2K3SCluster(c.T(), standardUserClient, defaults.RKE2, provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(c.T(), err) } else { logrus.Infof("Using existing cluster %s", rancherConfig.ClusterName) diff --git a/validation/nodescaling/dualstack/defaults/defaults.yaml b/validation/nodescaling/dualstack/defaults/defaults.yaml index 6b75d274e..28de377b5 100644 --- a/validation/nodescaling/dualstack/defaults/defaults.yaml +++ b/validation/nodescaling/dualstack/defaults/defaults.yaml @@ -4,7 +4,10 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" - + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true + awsMachineConfigs: awsMachineConfig: - enablePrimaryIPv6: true diff --git a/validation/nodescaling/ipv6/defaults/defaults.yaml b/validation/nodescaling/ipv6/defaults/defaults.yaml index 6b75d274e..97d90faee 100644 --- a/validation/nodescaling/ipv6/defaults/defaults.yaml +++ b/validation/nodescaling/ipv6/defaults/defaults.yaml @@ -4,6 +4,9 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true awsMachineConfigs: awsMachineConfig: diff --git a/validation/nodescaling/ipv6/scaling_test.go b/validation/nodescaling/ipv6/scaling_test.go index dabad3899..0bd56c2ea 100644 --- a/validation/nodescaling/ipv6/scaling_test.go +++ b/validation/nodescaling/ipv6/scaling_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" extClusters "github.com/rancher/shepherd/extensions/clusters" @@ -19,7 +18,6 @@ import ( "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/machinepools" "github.com/rancher/tests/actions/provisioning" - "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/workloads/deployment" "github.com/rancher/tests/actions/workloads/pods" @@ -77,18 +75,6 @@ func (s *NodeScalingIPv6TestSuite) SetupSuite() { s.rke2Cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(s.T(), err) - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - logrus.Info("Provisioning K3s cluster") s.k3sCluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(s.T(), err) diff --git a/validation/provisioning/dualstack/defaults/defaults.yaml b/validation/provisioning/dualstack/defaults/defaults.yaml index 6b75d274e..28de377b5 100644 --- a/validation/provisioning/dualstack/defaults/defaults.yaml +++ b/validation/provisioning/dualstack/defaults/defaults.yaml @@ -4,7 +4,10 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" - + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true + awsMachineConfigs: awsMachineConfig: - enablePrimaryIPv6: true diff --git a/validation/provisioning/dualstack/k3s_custom_test.go b/validation/provisioning/dualstack/k3s_custom_test.go index c13f8b147..f96209f7e 100644 --- a/validation/provisioning/dualstack/k3s_custom_test.go +++ b/validation/provisioning/dualstack/k3s_custom_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/ec2" "github.com/rancher/shepherd/clients/rancher" "github.com/rancher/shepherd/pkg/config" @@ -123,18 +122,6 @@ func TestCustomK3SDualstack(t *testing.T) { clusterConfig.MachinePools = tt.machinePools clusterConfig.Networking = tt.networking - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/validation/provisioning/dualstack/k3s_node_driver_test.go b/validation/provisioning/dualstack/k3s_node_driver_test.go index 8b2cbdaac..38a533648 100644 --- a/validation/provisioning/dualstack/k3s_node_driver_test.go +++ b/validation/provisioning/dualstack/k3s_node_driver_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" "github.com/rancher/shepherd/extensions/cloudcredentials" "github.com/rancher/shepherd/pkg/config" @@ -111,18 +110,6 @@ func TestNodeDriverK3S(t *testing.T) { clusterConfig.MachinePools = tt.machinePools clusterConfig.Networking = tt.networking - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - provider := provisioning.CreateProvider(clusterConfig.Provider) credentialSpec := cloudcredentials.LoadCloudCredential(string(provider.Name)) machineConfigSpec := provider.LoadMachineConfigFunc(k.cattleConfig) diff --git a/validation/provisioning/ipv6/defaults/defaults.yaml b/validation/provisioning/ipv6/defaults/defaults.yaml index e06ea6473..073b06a48 100644 --- a/validation/provisioning/ipv6/defaults/defaults.yaml +++ b/validation/provisioning/ipv6/defaults/defaults.yaml @@ -4,7 +4,10 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" - + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true + awsMachineConfigs: awsMachineConfig: - enablePrimaryIPv6: true diff --git a/validation/provisioning/ipv6/k3s_custom_test.go b/validation/provisioning/ipv6/k3s_custom_test.go index 5bb6b7a0c..34e184366 100644 --- a/validation/provisioning/ipv6/k3s_custom_test.go +++ b/validation/provisioning/ipv6/k3s_custom_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/ec2" "github.com/rancher/shepherd/clients/rancher" "github.com/rancher/shepherd/pkg/config" @@ -122,18 +121,6 @@ func TestCustomK3SIPv6(t *testing.T) { clusterConfig.MachinePools[i].SpecifyCustomPrivateIP = true } - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/validation/provisioning/ipv6/k3s_node_driver_test.go b/validation/provisioning/ipv6/k3s_node_driver_test.go index 96b04edfd..2ae60e4c0 100644 --- a/validation/provisioning/ipv6/k3s_node_driver_test.go +++ b/validation/provisioning/ipv6/k3s_node_driver_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" "github.com/rancher/shepherd/extensions/cloudcredentials" "github.com/rancher/shepherd/pkg/config" @@ -116,18 +115,6 @@ func TestNodeDriverK3SIPv6(t *testing.T) { clusterConfig.MachinePools = tt.machinePools clusterConfig.Networking = tt.networking - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/validation/snapshot/defaults/defaults.yaml b/validation/snapshot/k3s/defaults/defaults.yaml similarity index 100% rename from validation/snapshot/defaults/defaults.yaml rename to validation/snapshot/k3s/defaults/defaults.yaml diff --git a/validation/snapshot/k3s/dualstack/defaults/defaults.yaml b/validation/snapshot/k3s/dualstack/defaults/defaults.yaml index 6b75d274e..97d90faee 100644 --- a/validation/snapshot/k3s/dualstack/defaults/defaults.yaml +++ b/validation/snapshot/k3s/dualstack/defaults/defaults.yaml @@ -4,6 +4,9 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true awsMachineConfigs: awsMachineConfig: diff --git a/validation/snapshot/k3s/ipv6/defaults/defaults.yaml b/validation/snapshot/k3s/ipv6/defaults/defaults.yaml index 6b75d274e..28de377b5 100644 --- a/validation/snapshot/k3s/ipv6/defaults/defaults.yaml +++ b/validation/snapshot/k3s/ipv6/defaults/defaults.yaml @@ -4,7 +4,10 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" - + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true + awsMachineConfigs: awsMachineConfig: - enablePrimaryIPv6: true diff --git a/validation/snapshot/k3s/ipv6/snapshot_restore_test.go b/validation/snapshot/k3s/ipv6/snapshot_restore_test.go index 79f83406d..192b2bfe2 100644 --- a/validation/snapshot/k3s/ipv6/snapshot_restore_test.go +++ b/validation/snapshot/k3s/ipv6/snapshot_restore_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" extClusters "github.com/rancher/shepherd/extensions/clusters" @@ -19,7 +18,6 @@ import ( "github.com/rancher/tests/actions/etcdsnapshot" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" - "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -73,21 +71,9 @@ func (s *SnapshotIPv6RestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { - if clusterConfig.Advanced == nil { - clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if clusterConfig.Advanced.MachineGlobalConfig == nil { - clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) logrus.Info("Provisioning K3s cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) diff --git a/validation/snapshot/k3s/snapshot_recurring_test.go b/validation/snapshot/k3s/snapshot_recurring_test.go index 53799a06f..98ccf9ba4 100644 --- a/validation/snapshot/k3s/snapshot_recurring_test.go +++ b/validation/snapshot/k3s/snapshot_recurring_test.go @@ -67,10 +67,10 @@ func (s *SnapshotRecurringTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning K3S cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/k3s/snapshot_restore_test.go b/validation/snapshot/k3s/snapshot_restore_test.go index 578bf97a0..a85feb79b 100644 --- a/validation/snapshot/k3s/snapshot_restore_test.go +++ b/validation/snapshot/k3s/snapshot_restore_test.go @@ -72,10 +72,10 @@ func (s *SnapshotRestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning K3S cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/k3s/snapshot_retention_test.go b/validation/snapshot/k3s/snapshot_retention_test.go index 954e4b2c9..e1a1edc3d 100644 --- a/validation/snapshot/k3s/snapshot_retention_test.go +++ b/validation/snapshot/k3s/snapshot_retention_test.go @@ -74,10 +74,10 @@ func (s *SnapshotRetentionTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning K3S cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/k3s/snapshot_s3_restore_test.go b/validation/snapshot/k3s/snapshot_s3_restore_test.go index 1170164be..518c94648 100644 --- a/validation/snapshot/k3s/snapshot_s3_restore_test.go +++ b/validation/snapshot/k3s/snapshot_s3_restore_test.go @@ -68,10 +68,10 @@ func (s *S3SnapshotRestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning K3S cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/defaults/defaults.yaml b/validation/snapshot/rke2/defaults/defaults.yaml index e69de29bb..cad7b879b 100644 --- a/validation/snapshot/rke2/defaults/defaults.yaml +++ b/validation/snapshot/rke2/defaults/defaults.yaml @@ -0,0 +1,90 @@ +#Required for all tests +rancher: + host: "" + adminToken: "" + insecure: true + cleanup: true + +#Required for all tests except template +clusterConfig: + machinePools: + - machinePoolConfig: + etcd: true + controlplane: false + worker: false + quantity: 3 + - machinePoolConfig: + etcd: false + controlplane: true + worker: false + quantity: 2 + - machinePoolConfig: + etcd: false + controlplane: false + worker: true + quantity: 3 + kubernetesVersion: "" + cni: "calico" + provider: "aws" + nodeProvider: "ec2" + +#Required for all tests +awsCredentials: + secretKey: "" + accessKey: "" + defaultRegion: "us-east-2" + +#Required for tests that utilize node driver clusters +awsMachineConfigs: + region: "us-east-2" + awsMachineConfig: + - roles: ["etcd","controlplane","worker"] + ami: "" + instanceType: "t3a.xlarge" + volumeType: "" + rootSize: "" + sshUser: "" + vpcId: "" + retries: "5" + zone: "a" + - roles: ["windows"] + ami: "" + instanceType: "t2.2xlarge" + sshUser: "" + vpcId: "" + volumeType: "" + zone: "a" + retries: "5" + rootSize: "100" + +#Required for tests that utilize custom clusters +awsEC2Configs: + region: "us-east-2" + awsSecretAccessKey: "" + awsAccessKeyID: "" + awsEC2Config: + - instanceType: "t3a.medium" + awsRegionAZ: "" + awsSSHKeyName: "" + awsAMI: "" + awsSecurityGroups: [""] + awsSSHKeyName: "" + awsCICDInstanceTag: "" + awsIAMProfile: "" + awsUser: "" + volumeSize: 100 + roles: ["etcd", "controlplane", "worker"] + - instanceType: "t2.2xlarge" + awsRegionAZ: "" + awsSSHKeyName: "" + awsAMI: "" + awsSecurityGroups: [""] + awsSSHKeyName: "" + awsCICDInstanceTag: "" + awsIAMProfile: "" + awsUser: "" + volumeSize: 100 + roles: ["windows"] + +logging: + level: "info" \ No newline at end of file diff --git a/validation/snapshot/rke2/dualstack/snapshot_restore_test.go b/validation/snapshot/rke2/dualstack/snapshot_restore_test.go index ad356fce5..29918fad6 100644 --- a/validation/snapshot/rke2/dualstack/snapshot_restore_test.go +++ b/validation/snapshot/rke2/dualstack/snapshot_restore_test.go @@ -71,10 +71,10 @@ func (s *SnapshotDualstackRestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/ipv6/snapshot_restore_test.go b/validation/snapshot/rke2/ipv6/snapshot_restore_test.go index 875b11949..9856ab9e9 100644 --- a/validation/snapshot/rke2/ipv6/snapshot_restore_test.go +++ b/validation/snapshot/rke2/ipv6/snapshot_restore_test.go @@ -71,10 +71,10 @@ func (s *SnapshotIPv6RestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/snapshot_recurring_test.go b/validation/snapshot/rke2/snapshot_recurring_test.go index e228fff9e..e68f11a3b 100644 --- a/validation/snapshot/rke2/snapshot_recurring_test.go +++ b/validation/snapshot/rke2/snapshot_recurring_test.go @@ -67,10 +67,10 @@ func (s *SnapshotRecurringTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, true, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/snapshot_restore_test.go b/validation/snapshot/rke2/snapshot_restore_test.go index a8624c277..2692d7600 100644 --- a/validation/snapshot/rke2/snapshot_restore_test.go +++ b/validation/snapshot/rke2/snapshot_restore_test.go @@ -72,10 +72,10 @@ func (s *SnapshotRestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/snapshot_restore_wins_test.go b/validation/snapshot/rke2/snapshot_restore_wins_test.go index 4dbf36a18..e63e4dba5 100644 --- a/validation/snapshot/rke2/snapshot_restore_wins_test.go +++ b/validation/snapshot/rke2/snapshot_restore_wins_test.go @@ -86,9 +86,9 @@ func (s *SnapshotRestoreWindowsTestSuite) SetupSuite() { clusterConfig.MachinePools = nodeRolesStandard - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) logrus.Info("Provisioning RKE2 windows cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, awsEC2Configs, true, true) diff --git a/validation/snapshot/rke2/snapshot_retention_test.go b/validation/snapshot/rke2/snapshot_retention_test.go index d190ddb07..457bf007c 100644 --- a/validation/snapshot/rke2/snapshot_retention_test.go +++ b/validation/snapshot/rke2/snapshot_retention_test.go @@ -75,10 +75,10 @@ func (s *SnapshotRetentionTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/snapshot/rke2/snapshot_s3_restore_test.go b/validation/snapshot/rke2/snapshot_s3_restore_test.go index 92791f694..61809cb52 100644 --- a/validation/snapshot/rke2/snapshot_s3_restore_test.go +++ b/validation/snapshot/rke2/snapshot_s3_restore_test.go @@ -68,10 +68,10 @@ func (s *S3SnapshotRestoreTestSuite) SetupSuite() { rancherConfig := new(rancher.Config) operations.LoadObjectFromMap(defaults.RancherConfigKey, s.cattleConfig, rancherConfig) - provider := provisioning.CreateProvider(clusterConfig.Provider) - machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) - if rancherConfig.ClusterName == "" { + provider := provisioning.CreateProvider(clusterConfig.Provider) + machineConfigSpec := provider.LoadMachineConfigFunc(s.cattleConfig) + logrus.Info("Provisioning RKE2 cluster") s.cluster, err = resources.ProvisionRKE2K3SCluster(s.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *clusterConfig, machineConfigSpec, nil, false, false) require.NoError(s.T(), err) diff --git a/validation/upgrade/dualstack/defaults/defaults.yaml b/validation/upgrade/dualstack/defaults/defaults.yaml index 6b75d274e..97d90faee 100644 --- a/validation/upgrade/dualstack/defaults/defaults.yaml +++ b/validation/upgrade/dualstack/defaults/defaults.yaml @@ -4,6 +4,9 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true awsMachineConfigs: awsMachineConfig: diff --git a/validation/upgrade/ipv6/defaults/defaults.yaml b/validation/upgrade/ipv6/defaults/defaults.yaml index 6b75d274e..28de377b5 100644 --- a/validation/upgrade/ipv6/defaults/defaults.yaml +++ b/validation/upgrade/ipv6/defaults/defaults.yaml @@ -4,7 +4,10 @@ clusterConfig: clusterCIDR: "" serviceCIDR: "" stackPreference: "" - + advanced: + machineGlobalConfig: + flannel-ipv6-masq: true + awsMachineConfigs: awsMachineConfig: - enablePrimaryIPv6: true diff --git a/validation/upgrade/ipv6/kubernetes_test.go b/validation/upgrade/ipv6/kubernetes_test.go index 96a77e046..4612ad8e6 100644 --- a/validation/upgrade/ipv6/kubernetes_test.go +++ b/validation/upgrade/ipv6/kubernetes_test.go @@ -8,7 +8,6 @@ import ( upstream "github.com/qase-tms/qase-go/qase-api-client" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" extClusters "github.com/rancher/shepherd/extensions/clusters" @@ -21,7 +20,6 @@ import ( "github.com/rancher/tests/actions/config/defaults" "github.com/rancher/tests/actions/logging" "github.com/rancher/tests/actions/provisioning" - "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/qase" resources "github.com/rancher/tests/validation/provisioning/resources/provisioncluster" standard "github.com/rancher/tests/validation/provisioning/resources/standarduser" @@ -78,18 +76,6 @@ func (u *UpgradeIPv6KubernetesTestSuite) SetupSuite() { u.rke2Cluster, err = resources.ProvisionRKE2K3SCluster(u.T(), standardUserClient, extClusters.RKE2ClusterType.String(), provider, *u.clusterConfig, machineConfigSpec, nil, false, false) require.NoError(u.T(), err) - if u.clusterConfig.Advanced == nil { - u.clusterConfig.Advanced = &provisioninginput.Advanced{} - } - - if u.clusterConfig.Advanced.MachineGlobalConfig == nil { - u.clusterConfig.Advanced.MachineGlobalConfig = &rkev1.GenericMap{ - Data: map[string]any{}, - } - } - - u.clusterConfig.Advanced.MachineGlobalConfig.Data["flannel-ipv6-masq"] = true - logrus.Info("Provisioning K3s cluster") u.k3sCluster, err = resources.ProvisionRKE2K3SCluster(u.T(), standardUserClient, extClusters.K3SClusterType.String(), provider, *u.clusterConfig, machineConfigSpec, nil, false, false) require.NoError(u.T(), err)