Skip to content

Commit 1e61169

Browse files
[CLI]:Fix git provider (#558)
* Fix git provider * Up version * Refactor * Refactor * Refactor
1 parent ded8f1d commit 1e61169

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.502
1+
VERSION=v0.0.503
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/integrations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ var gitProvidersByName = map[string]model.GitProviders{
5353
"gitlab": model.GitProvidersGitlab,
5454
}
5555

56+
var gitProvidersByValue = util.ReverseMap(gitProvidersByName)
57+
5658
func NewIntegrationCommand() *cobra.Command {
5759
var (
5860
runtime string

cmd/commands/runtime_install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ To complete the installation:
706706
util.GenerateIngressPathForDemoGitEventSource(opts.RuntimeName),
707707
opts.RuntimeName,
708708
apiURL,
709-
opts.GitIntegrationCreationOpts.Provider,
709+
gitProvidersByValue[opts.GitIntegrationCreationOpts.Provider],
710710
opts.RuntimeName))
711711
summaryArr = append(summaryArr, summaryLog{skipIngressInfoMsg, Info})
712712
} else {

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.502/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.503/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.502/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.503/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

manifests/runtime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: "{{ namespace }}"
66
spec:
77
defVersion: 1.0.1
8-
version: 0.0.502
8+
version: 0.0.503
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

pkg/util/util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,11 @@ func Retry(ctx context.Context, opts *RetryOptions) error {
379379

380380
return err
381381
}
382+
383+
func ReverseMap[K, V comparable](gitProviders map[K]V) map[V]K {
384+
reversedMap := map[V]K{}
385+
for key, value := range gitProviders {
386+
reversedMap[value] = key
387+
}
388+
return reversedMap
389+
}

0 commit comments

Comments
 (0)