Skip to content

Commit

Permalink
mantle/ore: gcloud: remove bucket subpath from GCE image name
Browse files Browse the repository at this point in the history
Not sure why we needed this in the past but if I was trying to upload to
gs://mybucket/fedora-coreos my image name would get rewritten to append
the path `fedora-coreos` into the image name. For example:

- `fedora-coreos-31-20200404-dev-1-gcp-x86-64`

turns into

- `fedora-coreos-fedora-coreos-31-20200404-dev-1-gcp-x86-64`

This doesn't seem to be needed. Let's rework it so that transformation
doesn't happen.
  • Loading branch information
dustymabe committed Apr 6, 2020
1 parent 2f89706 commit bfb094c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mantle/cmd/ore/gcloud/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ func runUpload(cmd *cobra.Command, args []string) {
}

uploadBucket = gsURL.Host
uploadImageName = strings.TrimPrefix(gsURL.Path+"/"+uploadImageName, "/")
// create equivalent image names for GS and GCE
imageNameGS := strings.TrimPrefix(gsURL.Path+"/"+uploadImageName, "/") + ".tar.gz"

// Sanitize the image name for GCE
imageNameGCE := gceSanitize(uploadImageName)
imageNameGS := uploadImageName + ".tar.gz"

storageAPI, err := storage.New(api.Client())
if err != nil {
Expand Down

0 comments on commit bfb094c

Please sign in to comment.