Skip to content

Commit f95aa68

Browse files
Add default rb (#43)
1 parent 55cea25 commit f95aa68

File tree

8 files changed

+36
-7
lines changed

8 files changed

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

cmd/commands/runtime.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
190190
return fmt.Errorf("failed to get current server address: %w", err)
191191
}
192192

193-
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName, server, rt.Spec.Version.String())
193+
runtimeVersion := "v99.99.99"
194+
if rt.Spec.Version != nil { // in dev mode
195+
runtimeVersion = rt.Spec.Version.String()
196+
}
197+
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName, server, runtimeVersion)
194198
if err != nil {
195199
return fmt.Errorf("failed to create a new runtime: %w", err)
196200
}

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.47/cf-linux-amd64.tar.gz | tar zx
11+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.48/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.47/cf-darwin-amd64.tar.gz | tar zx
23+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.48/cf-darwin-amd64.tar.gz | tar zx
2424

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

manifests/argo-cd/default-rbac.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
name: codefresh-cm-reader
5+
rules:
6+
- apiGroups: [""]
7+
resources: ["configmaps"]
8+
resourceNames: ["codefresh-cm"]
9+
verbs: ["get"]
10+
11+
---
12+
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: RoleBinding
15+
metadata:
16+
name: codefresh-cm-reader
17+
roleRef:
18+
apiGroup: rbac.authorization.k8s.io
19+
kind: Role
20+
name: codefresh
21+
subjects:
22+
- kind: ServiceAccount
23+
name: default

manifests/argo-cd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Kustomization
33
resources:
44
- https://raw.githubusercontent.com/codefresh-io/argo-cd/release-2.1/manifests/install.yaml
55
- https://raw.githubusercontent.com/argoproj-labs/applicationset/master/manifests/install.yaml?ref=2c62537a8e5a # TODO: switch to the next release when available
6-
6+
- default-rbac.yaml
77
images:
88
- name: quay.io/argoproj/argocd
99
newName: quay.io/codefresh/argocd

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

pkg/runtime/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (r *Runtime) Save(fs fs.FS, filename string, config *CommonConfig) error {
131131
Kind: "ConfigMap",
132132
},
133133
ObjectMeta: metav1.ObjectMeta{
134-
Name: "codefresh-cm",
134+
Name: store.Get().CodefreshCM,
135135
Namespace: r.Namespace,
136136
Labels: map[string]string{
137137
apstore.Default.LabelKeyAppManagedBy: store.Get().BinaryName,

pkg/store/store.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type Store struct {
5555
EventsReporterName string
5656
WorkflowReporterName string
5757
CodefreshSA string
58+
CodefreshCM string
5859
ComponentsReporterName string
5960
ComponentsReporterSA string
6061
ComponentsReporterURL string
@@ -82,6 +83,7 @@ func init() {
8283
s.CFRuntimeDefType = "runtimeDef"
8384
s.CFRuntimeType = "runtime"
8485
s.CFTokenSecret = "codefresh-token"
86+
s.CodefreshCM = "codefresh-cm"
8587
s.CFTokenSecretKey = "token"
8688
s.ArgoCDTokenSecret = "argocd-token"
8789
s.ArgoCDTokenKey = "token"

0 commit comments

Comments
 (0)