Merge pull request #13354 from olemarkus/jobnames

Don't hash parts of the cluster name for e2e
This commit is contained in:
Kubernetes Prow Robot 2022-04-07 08:49:57 -07:00 committed by GitHub
commit 018edd45f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -17,7 +17,6 @@ limitations under the License.
package deployer package deployer
import ( import (
"crypto/md5"
"errors" "errors"
"fmt" "fmt"
"os" "os"
@ -234,9 +233,6 @@ func defaultClusterName(cloudProvider string) (string, error) {
return "", errors.New("PULL_NUMBER must be set when JOB_TYPE=presubmit and --cluster-name is not set") return "", errors.New("PULL_NUMBER must be set when JOB_TYPE=presubmit and --cluster-name is not set")
} }
buildIDHash := fmt.Sprintf("%x", md5.Sum([]byte(buildID)))
jobHash := fmt.Sprintf("%x", md5.Sum([]byte(jobName)))
var suffix string var suffix string
switch cloudProvider { switch cloudProvider {
case "aws": case "aws":
@ -246,10 +242,9 @@ func defaultClusterName(cloudProvider string) (string, error) {
} }
if jobType == "presubmit" { if jobType == "presubmit" {
pullHash := fmt.Sprintf("%x", md5.Sum([]byte(pullNumber))) return fmt.Sprintf("e2e-pr%s.%s.%s", pullNumber, jobName, suffix), nil
return fmt.Sprintf("e2e-%v-%v.%v", pullHash[:10], jobHash[:5], suffix), nil
} }
return fmt.Sprintf("e2e-%v-%v.%v", buildIDHash[:10], jobHash[:5], suffix), nil return fmt.Sprintf("e2e-%s.%s", jobName, suffix), nil
} }
// stateStore returns the kops state store to use // stateStore returns the kops state store to use