Skip to content

Commit b498ac6

Browse files
committed
fix(cli): Escape git branch refs for online store-type lookups.
fix(cli): fetch valid store-types from after logging is initialized. Signed-off-by: spbsoluble <1661003+spbsoluble@users.noreply.github.com>
1 parent 436c6ea commit b498ac6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/storeTypes.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"fmt"
2121
"io"
2222
"net/http"
23+
"net/url"
2324
"os"
2425
"sort"
2526
"strings"
@@ -93,7 +94,6 @@ var storesTypeCreateCmd = &cobra.Command{
9394
gitRef, _ := cmd.Flags().GetString(FlagGitRef)
9495
gitRepo, _ := cmd.Flags().GetString(FlagGitRepo)
9596
creatAll, _ := cmd.Flags().GetBool("all")
96-
validStoreTypes := getValidStoreTypes("", gitRef, gitRepo)
9797
storeType, _ := cmd.Flags().GetString("name")
9898
listTypes, _ := cmd.Flags().GetBool("list")
9999
storeTypeConfigFile, _ := cmd.Flags().GetString("from-file")
@@ -106,6 +106,8 @@ var storesTypeCreateCmd = &cobra.Command{
106106
}
107107
informDebug(debugFlag)
108108

109+
validStoreTypes := getValidStoreTypes("", gitRef, gitRepo)
110+
109111
// Authenticate
110112
kfClient, _ := initClient(false)
111113

@@ -505,7 +507,8 @@ func getStoreTypesInternet(gitRef string, repo string) (map[string]interface{},
505507
fileName = "integration-manifest.json"
506508
}
507509

508-
url := fmt.Sprintf(baseUrl, repo, gitRef, fileName)
510+
escapedGitRef := url.PathEscape(gitRef)
511+
url := fmt.Sprintf(baseUrl, repo, escapedGitRef, fileName)
509512
log.Debug().
510513
Str("url", url).
511514
Msg("Getting store types from internet")

0 commit comments

Comments
 (0)