Skip to content

Commit

Permalink
Merge pull request rancher#46888 from susesgartner/credentials-update2.9
Browse files Browse the repository at this point in the history
[2.9] Credentials update
  • Loading branch information
markusewalker authored Aug 29, 2024
2 parents 714e136 + d5f9e06 commit 78999d8
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 34 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ replace (
require (
github.com/antihax/optional v1.0.0
github.com/rancher/rancher/pkg/apis v0.0.0-20240719121207-baeda6b89fe3
github.com/rancher/shepherd v0.0.0-20240829173041-d255c925da7d
github.com/rancher/shepherd v0.0.0-20240829194632-40f661e08bd6
go.qase.io/client v0.0.0-20231114201952-65195ec001fa
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1794,8 +1794,8 @@ github.com/rancher/remotedialer v0.4.0 h1:T9yC5bFMsZFVQ6rK0dNrRg6rRb6Zr/4vsig8S0
github.com/rancher/remotedialer v0.4.0/go.mod h1:Ys004RpJuTLSm+k4aYUCoFiOOad37ubYev3TkOFg/5w=
github.com/rancher/rke v1.6.1 h1:ipktVDW1Xcs2SIR4vB9vCxH09kVrfD+1RmcUtWIPUV8=
github.com/rancher/rke v1.6.1/go.mod h1:5xRbf3L8PxqJRhABjYRfaBqbpVqAnqyH3maUNQEuwvk=
github.com/rancher/shepherd v0.0.0-20240829173041-d255c925da7d h1:67/7UcaYRqLh5KiG8gX5TM7gXfmkq98yzPXeS77A6vo=
github.com/rancher/shepherd v0.0.0-20240829173041-d255c925da7d/go.mod h1:nVphr8v6qtXd0pth8wMCF9U5eKEPBIaD5+HQCH19uRw=
github.com/rancher/shepherd v0.0.0-20240829194632-40f661e08bd6 h1:Qz/LQ+nVPIC8A/rMy9gCJ29iGaTfy4d4u5nmAQtNpr8=
github.com/rancher/shepherd v0.0.0-20240829194632-40f661e08bd6/go.mod h1:nVphr8v6qtXd0pth8wMCF9U5eKEPBIaD5+HQCH19uRw=
github.com/rancher/steve v0.0.0-20240806133920-61be17faa3d2 h1:mmm2uQ1NsNCrr6jxq9eAdGxvaf+6061gV4BMvuhcT6I=
github.com/rancher/steve v0.0.0-20240806133920-61be17faa3d2/go.mod h1:Za4nSt0V6kIHRfUo6jTXKkv6ABMMCHINA8EzhzygCfk=
github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20210727200656-10b094e30007 h1:ru+mqGnxMmKeU0Q3XIDxkARvInDIqT1hH2amTcsjxI4=
Expand Down
6 changes: 3 additions & 3 deletions tests/v2/actions/charts/rke2template.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/rancher/rancher/tests/v2/actions/projects"
"github.com/rancher/shepherd/clients/rancher"
v1 "github.com/rancher/shepherd/clients/rancher/v1"
"github.com/rancher/shepherd/extensions/charts"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/clusters"
"github.com/rancher/shepherd/extensions/defaults"
"github.com/rancher/shepherd/extensions/wait"
Expand All @@ -21,7 +21,7 @@ const (
)

// InstallTemplateChart installs a template from a repo.
func InstallTemplateChart(client *rancher.Client, repoName, templateName, clusterName, k8sVersion string, credentials *cloudcredentials.CloudCredential) error {
func InstallTemplateChart(client *rancher.Client, repoName, templateName, clusterName, k8sVersion string, credentials *v1.SteveAPIObject) error {
latestVersion, err := client.Catalog.GetLatestChartVersion(templateName, repoName)
if err != nil {
return err
Expand Down Expand Up @@ -63,7 +63,7 @@ func InstallTemplateChart(client *rancher.Client, repoName, templateName, cluste
return err
}

chartInstallAction := TemplateInstallAction(chartInstallActionPayload, repoName, clusterName, credentials.ID, k8sVersion, fleetNamespace, chartValues)
chartInstallAction := TemplateInstallAction(chartInstallActionPayload, repoName, clusterName, credentials.Namespace+":"+credentials.Name, k8sVersion, fleetNamespace, chartValues)

catalogClient, err := client.GetClusterCatalogClient(installOptions.Cluster.ID)
if err != nil {
Expand Down
25 changes: 15 additions & 10 deletions tests/v2/actions/provisioning/creates.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/rancher/tests/v2/actions/secrets"
v1 "github.com/rancher/shepherd/clients/rancher/v1"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/aws"
"github.com/rancher/shepherd/extensions/cloudcredentials/azure"
"github.com/rancher/shepherd/extensions/cloudcredentials/google"
Expand Down Expand Up @@ -67,7 +68,8 @@ const (

// CreateProvisioningCluster provisions a non-rke1 cluster, then runs verify checks
func CreateProvisioningCluster(client *rancher.Client, provider Provider, clustersConfig *clusters.ClusterConfig, hostnameTruncation []machinepools.HostnameTruncation) (*v1.SteveAPIObject, error) {
cloudCredential, err := provider.CloudCredFunc(client)
credentialSpec := cloudcredentials.LoadCloudCredential(string(provider.Name))
cloudCredential, err := provider.CloudCredFunc(client, credentialSpec)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -138,9 +140,9 @@ func CreateProvisioningCluster(client *rancher.Client, provider Provider, cluste

vcenterCredentials := map[string]interface{}{
"datacenters": machinePoolConfigs[0].Object["datacenter"],
"host": cloudCredential.VmwareVsphereConfig.Vcenter,
"host": credentialSpec.VmwareVsphereConfig.Vcenter,
"password": vsphere.GetVspherePassword(),
"username": cloudCredential.VmwareVsphereConfig.Username,
"username": credentialSpec.VmwareVsphereConfig.Username,
}
clustersConfig.AddOnConfig = &provisioninginput.AddOnConfig{
ChartValues: &rkev1.GenericMap{
Expand All @@ -159,7 +161,7 @@ func CreateProvisioningCluster(client *rancher.Client, provider Provider, cluste
}
}

cluster := clusters.NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, machinePools, cloudCredential.ID)
cluster := clusters.NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, machinePools, cloudCredential.Namespace+":"+cloudCredential.Name)

for _, truncatedPool := range hostnameTruncation {
if truncatedPool.PoolNameLengthLimit > 0 || truncatedPool.ClusterNameLengthLimit > 0 {
Expand Down Expand Up @@ -723,13 +725,14 @@ func CreateProvisioningRKE1AirgapCustomCluster(client *rancher.Client, clustersC

// CreateProvisioningAKSHostedCluster provisions an AKS cluster, then runs verify checks
func CreateProvisioningAKSHostedCluster(client *rancher.Client, aksClusterConfig aks.ClusterConfig) (*management.Cluster, error) {
cloudCredential, err := azure.CreateAzureCloudCredentials(client)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential("azure")
cloudCredential, err := azure.CreateAzureCloudCredentials(client, cloudCredentialConfig)
if err != nil {
return nil, err
}

clusterName := namegen.AppendRandomString("akshostcluster")
clusterResp, err := aks.CreateAKSHostedCluster(client, clusterName, cloudCredential.ID, aksClusterConfig, false, false, false, false, nil)
clusterResp, err := aks.CreateAKSHostedCluster(client, clusterName, cloudCredential.Namespace+":"+cloudCredential.Name, aksClusterConfig, false, false, false, false, nil)
if err != nil {
return nil, err
}
Expand All @@ -748,13 +751,14 @@ func CreateProvisioningAKSHostedCluster(client *rancher.Client, aksClusterConfig

// CreateProvisioningEKSHostedCluster provisions an EKS cluster, then runs verify checks
func CreateProvisioningEKSHostedCluster(client *rancher.Client, eksClusterConfig eks.ClusterConfig) (*management.Cluster, error) {
cloudCredential, err := aws.CreateAWSCloudCredentials(client)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential("aws")
cloudCredential, err := aws.CreateAWSCloudCredentials(client, cloudCredentialConfig)
if err != nil {
return nil, err
}

clusterName := namegen.AppendRandomString("ekshostcluster")
clusterResp, err := eks.CreateEKSHostedCluster(client, clusterName, cloudCredential.ID, eksClusterConfig, false, false, false, false, nil)
clusterResp, err := eks.CreateEKSHostedCluster(client, clusterName, cloudCredential.Namespace+":"+cloudCredential.Name, eksClusterConfig, false, false, false, false, nil)
if err != nil {
return nil, err
}
Expand All @@ -773,13 +777,14 @@ func CreateProvisioningEKSHostedCluster(client *rancher.Client, eksClusterConfig

// CreateProvisioningGKEHostedCluster provisions an GKE cluster, then runs verify checks
func CreateProvisioningGKEHostedCluster(client *rancher.Client, gkeClusterConfig gke.ClusterConfig) (*management.Cluster, error) {
cloudCredential, err := google.CreateGoogleCloudCredentials(client)
credentialSpec := cloudcredentials.LoadCloudCredential(provisioninginput.GoogleProviderName.String())
cloudCredential, err := google.CreateGoogleCloudCredentials(client, credentialSpec)
if err != nil {
return nil, err
}

clusterName := namegen.AppendRandomString("gkehostcluster")
clusterResp, err := gke.CreateGKEHostedCluster(client, clusterName, cloudCredential.ID, gkeClusterConfig, false, false, false, false, nil)
clusterResp, err := gke.CreateGKEHostedCluster(client, clusterName, cloudCredential.Namespace+":"+cloudCredential.Name, gkeClusterConfig, false, false, false, false, nil)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion tests/v2/actions/provisioning/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/rancher/rancher/tests/v2/actions/machinepools"
"github.com/rancher/rancher/tests/v2/actions/provisioninginput"
"github.com/rancher/shepherd/clients/rancher"
v1 "github.com/rancher/shepherd/clients/rancher/v1"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/aws"
"github.com/rancher/shepherd/extensions/cloudcredentials/azure"
Expand All @@ -23,7 +24,7 @@ import (
r1vsphere "github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates/vsphere"
)

type CloudCredFunc func(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error)
type CloudCredFunc func(rancherClient *rancher.Client, credentials cloudcredentials.CloudCredential) (*v1.SteveAPIObject, error)
type MachinePoolFunc func(generatedPoolName, namespace string) []unstructured.Unstructured

type Provider struct {
Expand Down
7 changes: 5 additions & 2 deletions tests/v2/actions/rke1/nodetemplates/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/shepherd/clients/rancher"
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/aws"
"github.com/rancher/shepherd/pkg/config"
)

const awsEC2NodeTemplateNameBase = "awsNodeConfig"
const providerName = "aws"

// CreateAWSNodeTemplate is a helper function that takes the rancher Client as a parameter and creates
// an AWS node template and returns the NodeTemplate response
func CreateAWSNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) {
var amazonEC2NodeTemplateConfig nodetemplates.AmazonEC2NodeTemplateConfig
config.LoadConfig(nodetemplates.AmazonEC2NodeTemplateConfigurationFileKey, &amazonEC2NodeTemplateConfig)

cloudCredential, err := aws.CreateAWSCloudCredentials(rancherClient)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(providerName)
cloudCredential, err := aws.CreateAWSCloudCredentials(rancherClient, cloudCredentialConfig)
if err != nil {
return nil, err
}
Expand All @@ -28,7 +31,7 @@ func CreateAWSNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTe
}

nodeTemplateConfig := &nodetemplates.NodeTemplate{
CloudCredentialID: cloudCredential.ID,
CloudCredentialID: cloudCredential.Namespace + ":" + cloudCredential.Name,
}

config.LoadConfig(nodetemplates.NodeTemplateConfigurationFileKey, nodeTemplateConfig)
Expand Down
7 changes: 5 additions & 2 deletions tests/v2/actions/rke1/nodetemplates/azure/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/shepherd/clients/rancher"
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/azure"
"github.com/rancher/shepherd/pkg/config"
)

const azureNodeTemplateNameBase = "azureNodeConfig"
const providerName = "azure"

// CreateAzureNodeTemplate is a helper function that takes the rancher Client as a parameter and creates
// an Azure node template and returns the NodeTemplate response
func CreateAzureNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) {
var azureNodeTemplateConfig nodetemplates.AzureNodeTemplateConfig
config.LoadConfig(nodetemplates.AzureNodeTemplateConfigurationFileKey, &azureNodeTemplateConfig)

cloudCredential, err := azure.CreateAzureCloudCredentials(rancherClient)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(providerName)
cloudCredential, err := azure.CreateAzureCloudCredentials(rancherClient, cloudCredentialConfig)
if err != nil {
return nil, err
}
Expand All @@ -28,7 +31,7 @@ func CreateAzureNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.Node
}

nodeTemplateConfig := &nodetemplates.NodeTemplate{
CloudCredentialID: cloudCredential.ID,
CloudCredentialID: cloudCredential.Namespace + ":" + cloudCredential.Name,
}

config.LoadConfig(nodetemplates.NodeTemplateConfigurationFileKey, nodeTemplateConfig)
Expand Down
7 changes: 5 additions & 2 deletions tests/v2/actions/rke1/nodetemplates/harvester/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/shepherd/clients/rancher"
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/harvester"
"github.com/rancher/shepherd/pkg/config"
)

const harvesterNodeTemplateNameBase = "harvesterNodeConfig"
const providerName = "harvester"

// CreateHarvesterNodeTemplate is a helper function that takes the rancher Client as a parameter and creates
// an Harvester node template and returns the NodeTemplate response
func CreateHarvesterNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) {
var harvesterNodeTemplateConfig nodetemplates.HarvesterNodeTemplateConfig
config.LoadConfig(nodetemplates.HarvesterNodeTemplateConfigurationFileKey, &harvesterNodeTemplateConfig)

cloudCredential, err := harvester.CreateHarvesterCloudCredentials(rancherClient)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(providerName)
cloudCredential, err := harvester.CreateHarvesterCloudCredentials(rancherClient, cloudCredentialConfig)
if err != nil {
return nil, err
}
Expand All @@ -28,7 +31,7 @@ func CreateHarvesterNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.
}

nodeTemplateConfig := &nodetemplates.NodeTemplate{
CloudCredentialID: cloudCredential.ID,
CloudCredentialID: cloudCredential.Namespace + ":" + cloudCredential.Name,
}

config.LoadConfig(nodetemplates.NodeTemplateConfigurationFileKey, nodeTemplateConfig)
Expand Down
7 changes: 5 additions & 2 deletions tests/v2/actions/rke1/nodetemplates/linode/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/shepherd/clients/rancher"
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/linode"
"github.com/rancher/shepherd/pkg/config"
)

const linodeNodeTemplateNameBase = "linodeNodeConfig"
const providerName = "linode"

// CreateLinodeNodeTemplate is a helper function that takes the rancher Client as a parameter and creates
// an Linode node template and returns the NodeTemplate response
func CreateLinodeNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) {
var linodeNodeTemplateConfig nodetemplates.LinodeNodeTemplateConfig
config.LoadConfig(nodetemplates.LinodeNodeTemplateConfigurationFileKey, &linodeNodeTemplateConfig)

cloudCredential, err := linode.CreateLinodeCloudCredentials(rancherClient)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(providerName)
cloudCredential, err := linode.CreateLinodeCloudCredentials(rancherClient, cloudCredentialConfig)
if err != nil {
return nil, err
}
Expand All @@ -28,7 +31,7 @@ func CreateLinodeNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.Nod
}

nodeTemplateConfig := &nodetemplates.NodeTemplate{
CloudCredentialID: cloudCredential.ID,
CloudCredentialID: cloudCredential.Namespace + ":" + cloudCredential.Name,
}

config.LoadConfig(nodetemplates.NodeTemplateConfigurationFileKey, nodeTemplateConfig)
Expand Down
7 changes: 5 additions & 2 deletions tests/v2/actions/rke1/nodetemplates/vsphere/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import (
"github.com/rancher/rancher/tests/v2/actions/rke1/nodetemplates"
"github.com/rancher/shepherd/clients/rancher"
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/cloudcredentials/vsphere"
"github.com/rancher/shepherd/pkg/config"
)

const vmwarevsphereNodeTemplateNameBase = "vmwarevsphereNodeConfig"
const providerName = "vsphere"

// CreateVSphereNodeTemplate is a helper function that takes the rancher Client as a parameter and creates
// a VSphere node template and returns the NodeTemplate response
func CreateVSphereNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) {
var vmwarevsphereNodeTemplateConfig nodetemplates.VmwareVsphereNodeTemplateConfig
config.LoadConfig(nodetemplates.VmwareVsphereNodeTemplateConfigurationFileKey, &vmwarevsphereNodeTemplateConfig)

cloudCredential, err := vsphere.CreateVsphereCloudCredentials(rancherClient)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(providerName)
cloudCredential, err := vsphere.CreateVsphereCloudCredentials(rancherClient, cloudCredentialConfig)
if err != nil {
return nil, err
}
Expand All @@ -28,7 +31,7 @@ func CreateVSphereNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.No
}

nodeTemplateConfig := &nodetemplates.NodeTemplate{
CloudCredentialID: cloudCredential.ID,
CloudCredentialID: cloudCredential.Namespace + ":" + cloudCredential.Name,
}

config.LoadConfig(nodetemplates.NodeTemplateConfigurationFileKey, nodeTemplateConfig)
Expand Down
8 changes: 5 additions & 3 deletions tests/v2/validation/provisioning/k3s/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/rancher/rancher/tests/v2/actions/provisioning"
"github.com/rancher/rancher/tests/v2/actions/provisioninginput"
"github.com/rancher/shepherd/clients/rancher"
v1 "github.com/rancher/shepherd/clients/rancher/v1"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/clusters"
"github.com/rancher/shepherd/extensions/clusters/kubernetesversions"
Expand All @@ -36,7 +37,7 @@ type ClusterTemplateTestSuite struct {
standardUserClient *rancher.Client
session *session.Session
templateConfig *provisioninginput.TemplateConfig
cloudCredentials *cloudcredentials.CloudCredential
cloudCredentials *v1.SteveAPIObject
}

func (r *ClusterTemplateTestSuite) TearDownSuite() {
Expand All @@ -55,11 +56,12 @@ func (r *ClusterTemplateTestSuite) SetupSuite() {
r.client = client

provider := provisioning.CreateProvider(r.templateConfig.TemplateProvider)
r.cloudCredentials, err = provider.CloudCredFunc(client)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(r.templateConfig.TemplateProvider)
r.cloudCredentials, err = provider.CloudCredFunc(client, cloudCredentialConfig)
require.NoError(r.T(), err)
}

func (r *ClusterTemplateTestSuite) TestProvisionK3sTemplateCluster() {
func (r *ClusterTemplateTestSuite) TestProvisionK3STemplateCluster() {
_, err := steve.CreateAndWaitForResource(r.client, stevetypes.ClusterRepo, r.templateConfig.Repo, true, 5*time.Second, defaults.FiveMinuteTimeout)
require.NoError(r.T(), err)

Expand Down
8 changes: 4 additions & 4 deletions tests/v2/validation/provisioning/rke2/template_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build (validation || extended) && !infra.any && !infra.aks && !infra.eks && !infra.gke && !infra.rke2k3s && !cluster.any && !cluster.custom && !cluster.nodedriver && !sanity && !stress

package rke2

import (
Expand All @@ -11,6 +9,7 @@ import (
"github.com/rancher/rancher/tests/v2/actions/provisioninginput"
"github.com/rancher/rancher/tests/v2/actions/reports"
"github.com/rancher/shepherd/clients/rancher"
v1 "github.com/rancher/shepherd/clients/rancher/v1"
"github.com/rancher/shepherd/extensions/cloudcredentials"
"github.com/rancher/shepherd/extensions/clusters"
"github.com/rancher/shepherd/extensions/clusters/kubernetesversions"
Expand All @@ -37,7 +36,7 @@ type ClusterTemplateTestSuite struct {
standardUserClient *rancher.Client
session *session.Session
templateConfig *provisioninginput.TemplateConfig
cloudCredentials *cloudcredentials.CloudCredential
cloudCredentials *v1.SteveAPIObject
}

func (r *ClusterTemplateTestSuite) TearDownSuite() {
Expand All @@ -56,7 +55,8 @@ func (r *ClusterTemplateTestSuite) SetupSuite() {
r.client = client

provider := provisioning.CreateProvider(r.templateConfig.TemplateProvider)
r.cloudCredentials, err = provider.CloudCredFunc(client)
cloudCredentialConfig := cloudcredentials.LoadCloudCredential(r.templateConfig.TemplateProvider)
r.cloudCredentials, err = provider.CloudCredFunc(client, cloudCredentialConfig)
require.NoError(r.T(), err)
}

Expand Down

0 comments on commit 78999d8

Please sign in to comment.