Skip to content

Commit df9632e

Browse files
CR-5778-2 (#41)
* final * update * update * update * update * update * update * update
1 parent 417340c commit df9632e

File tree

8 files changed

+30
-12
lines changed

8 files changed

+30
-12
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.45
1+
VERSION=v0.0.46
22
OUT_DIR=dist
33
YEAR?=$(shell date +"%Y")
44

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The new Codefresh CLI tool.
1515

1616
```bash
1717
# get the latest version or change to a specific version
18-
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-io/cli-v2/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
18+
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-io/cli-v2/releases/latest" | jq -r ".tag_name")
1919

2020
# download and extract the binary
2121
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/$VERSION/cf-darwin-amd64.tar.gz | tar zx
@@ -30,7 +30,7 @@ cf version
3030
### Linux
3131
```bash
3232
# get the latest version or change to a specific version
33-
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-io/cli-v2/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
33+
VERSION=$(curl --silent "https://api.github.com/repos/codefresh-io/cli-v2/releases/latest" | jq -r ".tag_name")
3434

3535
# download and extract the binary
3636
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/$VERSION/cf-linux-amd64.tar.gz | tar zx

cmd/commands/runtime.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
185185
return fmt.Errorf("failed to download runtime definition: %w", err)
186186
}
187187

188-
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName)
188+
server, err := util.CurrentServer()
189+
if err != nil {
190+
return fmt.Errorf("failed to get current server address: %w", err)
191+
}
192+
193+
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName, server, rt.Spec.Version.String())
189194
if err != nil {
190195
return fmt.Errorf("failed to create a new runtime: %w", err)
191196
}

docs/releases/release_notes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Argo CD [v2.1.0-rc1](https://github.com/codefresh-io/argo-cd/releases/tag/v2.1.0-rc1)
33
* Argo CD ApplicationSet Controller [2c62537a8e5a](https://github.com/argoproj-labs/applicationset/commit/2c62537a8e5a3d5aecad87b843870789b74bdf89)
44
* Argo Events [v1.4.0](https://github.com/argoproj/argo-events/releases/tag/v1.4.0)
5-
* Argo Rollouts [v1.0.2](https://github.com/argoproj/argo-rollouts/releases/tag/v1.0.2)
6-
* Argo Workflows [v3.1.2](https://github.com/argoproj/argo-workflows/releases/tag/v3.1.2)
5+
* Argo Rollouts [v1.0.4](https://github.com/argoproj/argo-rollouts/releases/tag/v1.0.4)
6+
* Argo Workflows [v3.1.3](https://github.com/argoproj/argo-workflows/releases/tag/v3.1.3)
77

88
### Linux
99
```bash
1010
# download and extract the binary
11-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.45/cf-linux-amd64.tar.gz | tar zx
11+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.46/cf-linux-amd64.tar.gz | tar zx
1212

1313
# move the binary to your $PATH
1414
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -20,7 +20,7 @@ cf version
2020
### Mac
2121
```bash
2222
# download and extract the binary
23-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.45/cf-darwin-amd64.tar.gz | tar zx
23+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.46/cf-darwin-amd64.tar.gz | tar zx
2424

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

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/argoproj/argo-workflows/v3 v3.1.0
1212
github.com/argoproj/gitops-engine v0.3.3 // indirect
1313
github.com/briandowns/spinner v1.13.0
14-
github.com/codefresh-io/go-sdk v0.30.1
14+
github.com/codefresh-io/go-sdk v0.30.2
1515
github.com/fatih/color v1.12.0
1616
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
1717
github.com/go-git/go-billy/v5 v5.3.1
@@ -25,6 +25,7 @@ require (
2525
github.com/stretchr/testify v1.7.0
2626
k8s.io/api v0.21.1
2727
k8s.io/apimachinery v0.21.1
28+
k8s.io/client-go v11.0.1-0.20190816222228-6d55c1b1f1ca+incompatible
2829
sigs.k8s.io/kustomize/api v0.8.8
2930
)
3031

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
268268
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
269269
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
270270
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
271-
github.com/codefresh-io/go-sdk v0.30.1 h1:NmXSodeyqjbh+75e7jpfhum/9F44Fn+j44RgQazqSrs=
272-
github.com/codefresh-io/go-sdk v0.30.1/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
271+
github.com/codefresh-io/go-sdk v0.30.2 h1:NbWph0RUsE9R6Iesm+pvB+5ODuFCGyofbSTrbfx3w4o=
272+
github.com/codefresh-io/go-sdk v0.30.2/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
273273
github.com/colinmarc/hdfs v1.1.4-0.20180802165501-48eb8d6c34a9/go.mod h1:0DumPviB681UcSuJErAbDIOx6SIaJWj463TymfZG02I=
274274
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31/go.mod h1:vSBumefK4HA5uiRSwNP+3ofgrEoScpCS2MMWcWXEuQ4=
275275
github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=

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

pkg/util/util.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/codefresh-io/cli-v2/pkg/store"
2929

3030
"github.com/briandowns/spinner"
31+
"k8s.io/client-go/tools/clientcmd"
3132
)
3233

3334
const (
@@ -155,3 +156,14 @@ func (ar *AsyncRunner) Wait() error {
155156
func EscapeAppsetFieldName(field string) string {
156157
return appsetFieldRegexp.ReplaceAllString(field, "_")
157158
}
159+
160+
func CurrentServer() (string, error) {
161+
configAccess := clientcmd.NewDefaultPathOptions()
162+
conf, err := configAccess.GetStartingConfig()
163+
if err != nil {
164+
return "", err
165+
}
166+
167+
server := conf.Clusters[conf.Contexts[conf.CurrentContext].Cluster].Server
168+
return server, nil
169+
}

0 commit comments

Comments
 (0)