Skip to content

Commit 7871d36

Browse files
Cr 13549 (#519)
* initial commit * fixes according to code review * bump
1 parent 3d5dee5 commit 7871d36

File tree

9 files changed

+24
-27
lines changed

9 files changed

+24
-27
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.464
1+
VERSION=v0.0.465
22

33

44
OUT_DIR=dist

cmd/commands/integrations.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ func NewGitIntegrationCommand(client *sdk.AppProxyAPI) *cobra.Command {
9595
}
9696

9797
func NewGitIntegrationListCommand(client *sdk.AppProxyAPI) *cobra.Command {
98-
var (
99-
format string
100-
)
98+
var format string
10199

102100
allowedFormats := []string{"list", "yaml", "yml", "json"}
103101

@@ -318,9 +316,7 @@ func RunGitIntegrationRemoveCommand(ctx context.Context, client sdk.AppProxyAPI,
318316
}
319317

320318
func NewGitIntegrationRegisterCommand(client *sdk.AppProxyAPI) *cobra.Command {
321-
var (
322-
opts model.RegisterToGitIntegrationArgs
323-
)
319+
var opts model.RegisterToGitIntegrationArgs
324320

325321
cmd := &cobra.Command{
326322
Use: "register [NAME]",
@@ -356,9 +352,7 @@ func RunGitIntegrationRegisterCommand(ctx context.Context, client sdk.AppProxyAP
356352
}
357353

358354
func NewGitIntegrationDeregisterCommand(client *sdk.AppProxyAPI) *cobra.Command {
359-
var (
360-
integration *string
361-
)
355+
var integration *string
362356

363357
cmd := &cobra.Command{
364358
Use: "deregister [NAME]",

cmd/commands/runtime_install.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,15 @@ func ensureIngressClass(ctx context.Context, opts *RuntimeInstallOptions) error
480480
ingressClassNames = append(ingressClassNames, ic.Name)
481481
ingressClassNameToController[ic.Name] = ingressutil.GetController(string(controller))
482482

483-
if opts.IngressClass == ic.Name { //if ingress class provided via flag
483+
if opts.IngressClass == ic.Name { // if ingress class provided via flag
484484
isValidClass = true
485485
}
486486
break
487487
}
488488
}
489489
}
490490

491-
if opts.IngressClass != "" { //if ingress class provided via flag
491+
if opts.IngressClass != "" { // if ingress class provided via flag
492492
if !isValidClass {
493493
return fmt.Errorf("ingress class '%s' is not supported", opts.IngressClass)
494494
}
@@ -581,13 +581,18 @@ func runRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
581581
}()
582582

583583
ingressControllerName := opts.IngressController.Name()
584+
gitProvider, err := parseGitProvider(string(opts.gitProvider.Type()))
585+
if err != nil {
586+
return err
587+
}
584588

585589
repoURL := opts.InsCloneOpts.URL()
586590
token, iv, err := createRuntimeOnPlatform(ctx, &model.RuntimeInstallationArgs{
587591
RuntimeName: opts.RuntimeName,
588592
Cluster: server,
589593
RuntimeVersion: runtimeVersion,
590594
IngressHost: &opts.IngressHost,
595+
GitProvider: model.GitProviders(gitProvider),
591596
InternalIngressHost: &opts.InternalIngressHost,
592597
IngressClass: &opts.IngressClass,
593598
IngressController: &ingressControllerName,

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.464/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.465/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.464/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.465/cf-darwin-amd64.tar.gz | tar zx
4040

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/argoproj/argo-events v0.17.1-0.20220327045437-70eaafe9afec
1111
github.com/argoproj/argo-workflows/v3 v3.3.1
1212
github.com/briandowns/spinner v1.18.1
13-
github.com/codefresh-io/go-sdk v0.45.0
13+
github.com/codefresh-io/go-sdk v0.46.0
1414
github.com/fatih/color v1.13.0
1515
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
1616
github.com/go-git/go-billy/v5 v5.3.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h
262262
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
263263
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
264264
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
265-
github.com/codefresh-io/go-sdk v0.45.0 h1:mgQYkaA0lC5L60MBdkNS3UvpGyx6rYWo5WEWcKNSRNA=
266-
github.com/codefresh-io/go-sdk v0.45.0/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
265+
github.com/codefresh-io/go-sdk v0.46.0 h1:bqspXepPrH11Ve9cX9poJivysl6NePfJve+A1Ulv3eA=
266+
github.com/codefresh-io/go-sdk v0.46.0/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
267267
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
268268
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
269269
github.com/container-storage-interface/spec v1.5.0/go.mod h1:8K96oQNkJ7pFcC2R9Z1ynGGBB1I93kcS6PGg3SsOk8s=

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.464
8+
version: 0.0.465
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

pkg/git/provider.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ const (
3838
PersonalToken TokenType = "personal token"
3939
)
4040

41-
var (
42-
providers = map[ProviderType]func(string) (Provider, error){
43-
BITBUCKET_SERVER: NewBitbucketServerProvider,
44-
GITHUB: NewGithubProvider,
45-
GITHUB_ENT: NewGithubProvider, // for backward compatability
46-
GITLAB: NewGitlabProvider,
47-
}
48-
)
41+
var providers = map[ProviderType]func(string) (Provider, error){
42+
BITBUCKET_SERVER: NewBitbucketServerProvider,
43+
GITHUB: NewGithubProvider,
44+
GITHUB_ENT: NewGithubProvider, // for backward compatability
45+
GITLAB: NewGitlabProvider,
46+
}
4947

5048
func GetProvider(providerType ProviderType, baseURL string) (Provider, error) {
5149
if providerType != "" {

pkg/git/provider_bitbucket-server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewBitbucketServerProvider(baseURL string) (Provider, error) {
4242
u.Path = BITBUCKET_REST_ENDPOINT
4343
return &bitbucketServer{
4444
providerType: BITBUCKET_SERVER,
45-
apiURL: u,
45+
apiURL: u,
4646
}, nil
4747
}
4848

0 commit comments

Comments
 (0)