diff --git a/actions/cloudprovider/cloudprovider.go b/actions/cloudprovider/cloudprovider.go index cce4a2681..d3f7fea11 100644 --- a/actions/cloudprovider/cloudprovider.go +++ b/actions/cloudprovider/cloudprovider.go @@ -13,7 +13,6 @@ import ( "github.com/rancher/shepherd/extensions/cloudcredentials" "github.com/rancher/shepherd/extensions/cloudcredentials/vsphere" - "github.com/rancher/shepherd/extensions/harvester" "github.com/rancher/tests/actions/clusters" "github.com/rancher/tests/actions/provisioninginput" "github.com/rancher/tests/actions/secrets" @@ -108,13 +107,10 @@ func CreateCloudProviderAddOns(client *rancher.Client, clustersConfig *clusters. } case provisioninginput.HarvesterProviderName.String(): - kubeconfig, err := harvester.GetHarvesterSAKubeconfig(client, additionalData["clusterName"].(string)) - if err != nil { - return clustersConfig, err - } + data := map[string][]byte{ - "credential": kubeconfig, + "credential": []byte(credentials.HarvesterCredentialConfig.KubeconfigContent), } annotations := map[string]string{ diff --git a/validation/pipeline/tfp/Jenkinsfile.harvester.e2e b/validation/pipeline/tfp/Jenkinsfile.harvester.e2e index e2467effb..6637d4224 100644 --- a/validation/pipeline/tfp/Jenkinsfile.harvester.e2e +++ b/validation/pipeline/tfp/Jenkinsfile.harvester.e2e @@ -425,7 +425,6 @@ echo "}\\n" >> "${tfvars_filepath}" # echo "\\nEOF\\n}\\n" >> "${tfvars_filepath}" """ - // run the test with tofu sh """ @@ -437,6 +436,9 @@ echo "}\\n" >> "${tfvars_filepath}" . /root/playbook.env . ./validation/pipeline/scripts/register_downstream_cluster.sh ' + + docker cp ${testContainer}-ds:/root/go/src/github.com/rancher/qa-infra-automation/config.yml mid_config.yml + docker stop ${testContainer}-ds || true; docker rm ${testContainer}-ds sleep 90 """ @@ -444,33 +446,55 @@ echo "}\\n" >> "${tfvars_filepath}" } } stage('Run Validation Tests') { + if (env.CONNECT_HARVESTER_AND_RANCHER == "true") { try { - sh """ - docker run -v ${validationVolume}:/root --name ${golangTestContainer} -t ${imageName}${TOFU_VERSION}${HARVESTER_PROVIDER_VERSION}${RANCHER2_PROVIDER_VERSION}-${commitIDTest}:${commitIDInfra} sh -c "cp \$CATTLE_TEST_CONFIG . && export CATTLE_TEST_CONFIG=/root/go/src/github.com/rancher/tests/config.yml && /root/go/bin/gotestsum --format standard-verbose --packages=${golangTestDir} --junitfile ${testResultsOut} -- -tags=${TAGS} ${GO_TEST_CASE} -timeout=${timeout} -v ;" - """ + + jobs = [:] + dir("infra-repo") { + def mainRancherConfigPath = "mid_config.yml" + + sh "yq e '.rancher.cleanup = true' -i ${mainRancherConfigPath}" + + + def configYaml = readFile(file: "${mainRancherConfigPath}") + + def goProvisioningParams = [ + string(name: 'TIMEOUT', value: timeout), + text(name: 'CONFIG', value: configYaml), + string(name: 'REPO', value: "${env.TEST_REPO}"), + string(name: 'BRANCH', value: "${testBranch}"), + // string(name: 'QASE_TEST_RUN_ID', value: "${testRunID}"), + string(name: 'TEST_PACKAGE', value: "${env.GO_TEST_PACKAGE}"), + string(name: 'GOTEST_TESTCASE', value: "${env.GO_TEST_CASE}"), + string(name: 'TAGS', value: "${env.TAGS}"), + ] + def individualJob = "go-freeform-job-harvester" + jobs["test-pit"] = { build job: individualJob, parameters: goProvisioningParams } + parallel jobs + } + } catch (err) { echo "${err} Test had failures.." } - - sh "docker cp ${golangTestContainer}:/root/go/src/github.com/rancher/tests/config.yml final_config.yml" - - def r_host = sh ( - script: "yq '.rancher.host' final_config.yml", - returnStdout: true - ).trim() - - def r_pass = sh ( - script: "yq '.rancher.adminPassword' final_config.yml", - returnStdout: true - ).trim() - - def h_host = sh ( - script: "yq '.harvester.host' final_config.yml", - returnStdout: true - ).trim() - - currentBuild.description = "https://${r_host}\\n${r_pass}\\nhttps://${h_host}\\n" + dir("infra-repo") { + def r_host = sh ( + script: "yq '.rancher.host' mid_config.yml", + returnStdout: true + ).trim() + + def r_pass = sh ( + script: "yq '.rancher.adminPassword' mid_config.yml", + returnStdout: true + ).trim() + + def h_host = sh ( + script: "yq '.harvester.host' mid_config.yml", + returnStdout: true + ).trim() + } + + currentBuild.description = "https://${r_host}
${r_pass}
https://${h_host}" sh """ docker stop ${golangTestContainer} || true