Skip to content

Commit

Permalink
Dont truncate the top level domains for GCP jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Aug 30, 2024
1 parent 4f8b2af commit 2ef7ebd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/e2e/kubetest2-kops/deployer/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,17 @@ func defaultClusterName(cloudProvider string) (string, error) {
jobName = jobName[:79]
}
if jobType == "presubmit" {
jobName = fmt.Sprintf("e2e-pr%s.%s.%s", pullNumber, jobName, suffix)
jobName = fmt.Sprintf("e2e-pr%s.%s", pullNumber, jobName)
} else {
jobName = fmt.Sprintf("e2e-%s.%s", jobName, suffix)
jobName = fmt.Sprintf("e2e-%s", jobName)
}
if len(jobName) > 63 && cloudProvider == "gce" { // GCP has char limit of 64
jobName = jobName[:63]

// GCP has char limit of 64
gcpLimit := 63 - (len(suffix) + 1) // 1 for the dot
if len(jobName) > gcpLimit && cloudProvider == "gce" {
jobName = jobName[:gcpLimit]
}
return jobName, nil
return fmt.Sprintf("%v.%v", jobName, suffix), nil
}

// stateStore returns the kops state store to use
Expand Down

0 comments on commit 2ef7ebd

Please sign in to comment.