Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions validation/certificates/k3s/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 1 addition & 15 deletions validation/certificates/k3s/dualstack/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 1 addition & 16 deletions validation/certificates/k3s/ipv6/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions validation/certificates/k3s/ipv6/defaults/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ clusterConfig:
clusterCIDR: "<required>"
serviceCIDR: "<required>"
stackPreference: "<required>"
advanced:
machineGlobalConfig:
flannel-ipv6-masq: true

awsMachineConfigs:
awsMachineConfig:
Expand Down
3 changes: 1 addition & 2 deletions validation/certificates/rke2/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions validation/certificates/rke2/cert_rotation_wins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
58 changes: 58 additions & 0 deletions validation/certificates/rke2/defaults/defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#Required for all tests
rancher:
host: "<required>"
adminToken: "<required>"
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: "<required>"
accessKey: "<required>"
defaultRegion: "us-east-2"

#Required for tests that utilize node driver clusters
awsMachineConfigs:
region: "us-east-2"
awsMachineConfig:
- roles: ["etcd","controlplane","worker"]
ami: "<required>"
instanceType: "t3a.medium"
sshUser: "<required>"
vpcId: "<required>"
retries: "5"
- roles: ["windows"]
ami: "<required>"
instanceType: "t2.2xlarge"
sshUser: "<required>"
vpcId: "<required>"
volumeType: "<required>"
zone: "a"
retries: "5"
rootSize: "100"

logging:
level: "info"
3 changes: 1 addition & 2 deletions validation/certificates/rke2/dualstack/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions validation/certificates/rke2/ipv6/cert_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion validation/nodescaling/dualstack/defaults/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ clusterConfig:
clusterCIDR: "<required>"
serviceCIDR: "<required>"
stackPreference: "<required>"

advanced:
machineGlobalConfig:
flannel-ipv6-masq: true

awsMachineConfigs:
awsMachineConfig:
- enablePrimaryIPv6: true
Expand Down
3 changes: 3 additions & 0 deletions validation/nodescaling/ipv6/defaults/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ clusterConfig:
clusterCIDR: "<required>"
serviceCIDR: "<required>"
stackPreference: "<required>"
advanced:
machineGlobalConfig:
flannel-ipv6-masq: true

awsMachineConfigs:
awsMachineConfig:
Expand Down
14 changes: 0 additions & 14 deletions validation/nodescaling/ipv6/scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion validation/provisioning/dualstack/defaults/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ clusterConfig:
clusterCIDR: "<required>"
serviceCIDR: "<required>"
stackPreference: "<required>"

advanced:
machineGlobalConfig:
flannel-ipv6-masq: true

awsMachineConfigs:
awsMachineConfig:
- enablePrimaryIPv6: true
Expand Down
13 changes: 0 additions & 13 deletions validation/provisioning/dualstack/k3s_custom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand Down
13 changes: 0 additions & 13 deletions validation/provisioning/dualstack/k3s_node_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion validation/provisioning/ipv6/defaults/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ clusterConfig:
clusterCIDR: "<required>"
serviceCIDR: "<required>"
stackPreference: "<required>"

advanced:
machineGlobalConfig:
flannel-ipv6-masq: true

awsMachineConfigs:
awsMachineConfig:
- enablePrimaryIPv6: true
Expand Down
Loading