From 2e3c9f3a36c9fe243baa7f78fdd16238f1a8fba6 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Thu, 10 Mar 2022 15:03:23 +0100 Subject: [PATCH] Don't hash parts of the cluster name for e2e Previously we hashed the name because the IAM role names otherwise became too large. This has since been fixed. We want to avoid hashing to better understand what tests/runs may leak resources. --- tests/e2e/kubetest2-kops/deployer/common.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/e2e/kubetest2-kops/deployer/common.go b/tests/e2e/kubetest2-kops/deployer/common.go index 08c5a1d5fd..29b69943bc 100644 --- a/tests/e2e/kubetest2-kops/deployer/common.go +++ b/tests/e2e/kubetest2-kops/deployer/common.go @@ -17,7 +17,6 @@ limitations under the License. package deployer import ( - "crypto/md5" "errors" "fmt" "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") } - buildIDHash := fmt.Sprintf("%x", md5.Sum([]byte(buildID))) - jobHash := fmt.Sprintf("%x", md5.Sum([]byte(jobName))) - var suffix string switch cloudProvider { case "aws": @@ -246,10 +242,9 @@ func defaultClusterName(cloudProvider string) (string, error) { } if jobType == "presubmit" { - pullHash := fmt.Sprintf("%x", md5.Sum([]byte(pullNumber))) - return fmt.Sprintf("e2e-%v-%v.%v", pullHash[:10], jobHash[:5], suffix), nil + return fmt.Sprintf("e2e-pr%s.%s.%s", pullNumber, jobName, 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