Kubetest2 - Ensure the bucket path is the final gsutil arg

should fix this error: https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/e2e-kops-gce-kubetest2/1381650445893636096#1:build-log.txt%3A122
This commit is contained in:
Peter Rifel 2021-04-12 09:57:47 -07:00
parent 8ea4a7d161
commit ecf03b1c27
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
1 changed files with 4 additions and 2 deletions

View File

@ -41,11 +41,12 @@ func GCSBucketName(projectID string) string {
func EnsureGCSBucket(bucketPath, projectID string) error {
lsArgs := []string{
"gsutil", "ls", "-b", bucketPath,
"gsutil", "ls", "-b",
}
if projectID != "" {
lsArgs = append(lsArgs, "-p", projectID)
}
lsArgs = append(lsArgs, bucketPath)
klog.Info(strings.Join(lsArgs, " "))
cmd := exec.Command(lsArgs[0], lsArgs[1:]...)
@ -59,11 +60,12 @@ func EnsureGCSBucket(bucketPath, projectID string) error {
}
mbArgs := []string{
"gsutil", "mb", bucketPath,
"gsutil", "mb",
}
if projectID != "" {
mbArgs = append(mbArgs, "-p", projectID)
}
mbArgs = append(mbArgs, bucketPath)
klog.Info(strings.Join(mbArgs, " "))
cmd = exec.Command(mbArgs[0], mbArgs[1:]...)