Merge pull request #16217 from ameukam/dns-override

Allow override of the DNS domain used by the tests.
This commit is contained in:
Kubernetes Prow Robot 2024-01-04 16:13:32 +01:00 committed by GitHub
commit 46c5d3ddaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -255,10 +255,14 @@ func (d *deployer) featureFlags() string {
// defaultClusterName returns a kops cluster name to use when ClusterName is not set
func defaultClusterName(cloudProvider string) (string, error) {
dnsDomain := os.Getenv("KOPS_DNS_DOMAIN")
jobName := os.Getenv("JOB_NAME")
jobType := os.Getenv("JOB_TYPE")
buildID := os.Getenv("BUILD_ID")
pullNumber := os.Getenv("PULL_NUMBER")
if dnsDomain == "" {
dnsDomain = "test-cncf-aws.k8s.io"
}
if jobName == "" || buildID == "" {
return "", errors.New("JOB_NAME, and BUILD_ID env vars are required when --cluster-name is not set")
}
@ -269,7 +273,7 @@ func defaultClusterName(cloudProvider string) (string, error) {
var suffix string
switch cloudProvider {
case "aws":
suffix = "test-cncf-aws.k8s.io"
suffix = dnsDomain
default:
suffix = "k8s.local"
}