Skip to content

Commit

Permalink
Use a UUID for the source archive rather than random values
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis committed May 21, 2021
1 parent b79e0cb commit cdefb86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/skaffold/build/gcb/cloud_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cdefb86

Please sign in to comment.