From cdefb867074058fd89c079d10260e19e3846e599 Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 21 May 2021 11:56:21 -0400 Subject: [PATCH] Use a UUID for the source archive rather than random values --- pkg/skaffold/build/gcb/cloud_build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/skaffold/build/gcb/cloud_build.go b/pkg/skaffold/build/gcb/cloud_build.go index 875820164cf..517592f4ef5 100644 --- a/pkg/skaffold/build/gcb/cloud_build.go +++ b/pkg/skaffold/build/gcb/cloud_build.go @@ -27,6 +27,7 @@ import ( "time" cstorage "cloud.google.com/go/storage" + "github.com/google/uuid" "github.com/sirupsen/logrus" "google.golang.org/api/cloudbuild/v1" "google.golang.org/api/googleapi" @@ -40,7 +41,6 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/gcp" latestV1 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest/v1" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/sources" - "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) // Build builds a list of artifacts with Google Cloud Build. @@ -85,7 +85,7 @@ func (b *Builder) buildArtifactWithCloudBuild(ctx context.Context, out io.Writer } cbBucket := fmt.Sprintf("%s%s", projectID, constants.GCSBucketSuffix) - buildObject := fmt.Sprintf("source/%s-%s.tar.gz", projectID, util.RandomID()) + buildObject := fmt.Sprintf("source/%s-%s.tar.gz", projectID, uuid.New().String()) if err := b.createBucketIfNotExists(ctx, c, projectID, cbBucket); err != nil { return "", fmt.Errorf("creating bucket if not exists: %w", err)