Skip to content

Commit 4b666b9

Browse files
CR-4771 (#30)
* interpolated mutation * removed replace local in go.mod * bump * go-sdk bump * ci * bump
1 parent 88246ce commit 4b666b9

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
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.35
1+
VERSION=v0.0.36
22
OUT_DIR=dist
33
YEAR?=$(shell date +"%Y")
44

cmd/commands/runtime.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import (
5151
type (
5252
RuntimeInstallOptions struct {
5353
RuntimeName string
54+
RuntimeToken string
5455
Version *semver.Version
5556
gsCloneOpts *git.CloneOptions
5657
insCloneOpts *git.CloneOptions
@@ -177,6 +178,12 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
177178
return fmt.Errorf("failed to download runtime definition: %w", err)
178179
}
179180

181+
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName)
182+
if err != nil {
183+
return fmt.Errorf("failed to get a runtime creation response: %w", err)
184+
}
185+
opts.RuntimeToken = runtimeCreationResponse.NewAccessToken
186+
180187
log.G(ctx).WithField("version", rt.Spec.Version).Infof("installing runtime '%s'", opts.RuntimeName)
181188
err = apcmd.RunRepoBootstrap(ctx, &apcmd.RepoBootstrapOptions{
182189
AppSpecifier: rt.Spec.FullSpecifier(),
@@ -473,7 +480,7 @@ func persistRuntime(ctx context.Context, cloneOpts *git.CloneOptions, rt *runtim
473480
}
474481

475482
func createComponentsReporter(ctx context.Context, cloneOpts *git.CloneOptions, opts *RuntimeInstallOptions) error {
476-
tokenSecret, err := getTokenSecret(opts.RuntimeName)
483+
tokenSecret, err := getTokenSecret(opts.RuntimeName, opts.RuntimeToken)
477484
if err != nil {
478485
return fmt.Errorf("failed to create codefresh token secret: %w", err)
479486
}
@@ -552,8 +559,7 @@ var getProjectInfoFromFile = func(repofs fs.FS, name string) (*argocdv1alpha1.Ap
552559
return proj, appSet, nil
553560
}
554561

555-
func getTokenSecret(namespace string) ([]byte, error) {
556-
token := cfConfig.GetCurrentContext().Token
562+
func getTokenSecret(namespace string, token string) ([]byte, error) {
557563
return yaml.Marshal(&v1.Secret{
558564
TypeMeta: metav1.TypeMeta{
559565
APIVersion: "v1",

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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.35/cf-linux-amd64.tar.gz | tar zx
11+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.36/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.35/cf-darwin-amd64.tar.gz | tar zx
23+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.36/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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/argoproj/argo-events v1.3.1
1111
github.com/argoproj/argo-workflows/v3 v3.1.0
1212
github.com/briandowns/spinner v1.13.0
13-
github.com/codefresh-io/go-sdk v0.27.1
13+
github.com/codefresh-io/go-sdk v0.28.0
1414
github.com/fatih/color v1.12.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
@@ -265,8 +265,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
265265
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
266266
github.com/codefresh-io/argo-platform v1.35.0 h1:9rboz3DYnfdH9UdQhDQ6dkVLJWhnR5eHqH7mM+kyQcc=
267267
github.com/codefresh-io/argo-platform v1.35.0/go.mod h1:rNms+r6lqY5QPEkHROmh5jXKA8VrasuN6CfleuX2xFY=
268-
github.com/codefresh-io/go-sdk v0.27.1 h1:lN4VJhHxQKrMDth8yphl2kGRmxA4WWmJZA0YvTqxUtg=
269-
github.com/codefresh-io/go-sdk v0.27.1/go.mod h1:lm2qPmSJfqUBc+xUOB14/34paYLd1tIePMLMcdSxecs=
268+
github.com/codefresh-io/go-sdk v0.28.0 h1:yKL1EECpXsc7FauutwEh+mQcUDLf48tRkT4GcSQ+RAA=
269+
github.com/codefresh-io/go-sdk v0.28.0/go.mod h1:lm2qPmSJfqUBc+xUOB14/34paYLd1tIePMLMcdSxecs=
270270
github.com/colinmarc/hdfs v1.1.4-0.20180802165501-48eb8d6c34a9/go.mod h1:0DumPviB681UcSuJErAbDIOx6SIaJWj463TymfZG02I=
271271
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31/go.mod h1:vSBumefK4HA5uiRSwNP+3ofgrEoScpCS2MMWcWXEuQ4=
272272
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.35
8+
version: 0.0.36
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

0 commit comments

Comments
 (0)