From bfb094ccf1115f44c879a369cf05581c3e67fb56 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Mon, 6 Apr 2020 18:07:55 -0400 Subject: [PATCH] mantle/ore: gcloud: remove bucket subpath from GCE image name 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. --- mantle/cmd/ore/gcloud/upload.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mantle/cmd/ore/gcloud/upload.go b/mantle/cmd/ore/gcloud/upload.go index f7b2d0e61a..48b6e16ef1 100644 --- a/mantle/cmd/ore/gcloud/upload.go +++ b/mantle/cmd/ore/gcloud/upload.go @@ -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 {