Skip to content

Commit

Permalink
Add default rb (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
roi-codefresh authored Aug 4, 2021
1 parent 55cea25 commit f95aa68
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v0.0.47
VERSION=v0.0.48
OUT_DIR=dist
YEAR?=$(shell date +"%Y")

Expand Down
6 changes: 5 additions & 1 deletion cmd/commands/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
return fmt.Errorf("failed to get current server address: %w", err)
}

runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName, server, rt.Spec.Version.String())
runtimeVersion := "v99.99.99"
if rt.Spec.Version != nil { // in dev mode
runtimeVersion = rt.Spec.Version.String()
}
runtimeCreationResponse, err := cfConfig.NewClient().ArgoRuntime().Create(opts.RuntimeName, server, runtimeVersion)
if err != nil {
return fmt.Errorf("failed to create a new runtime: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions docs/releases/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
### Linux
```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.47/cf-linux-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.48/cf-linux-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-linux-amd64 /usr/local/bin/cf
Expand All @@ -20,7 +20,7 @@ cf version
### Mac
```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.47/cf-darwin-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.48/cf-darwin-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-darwin-amd64 /usr/local/bin/cf
Expand Down
23 changes: 23 additions & 0 deletions manifests/argo-cd/default-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: codefresh-cm-reader
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["codefresh-cm"]
verbs: ["get"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: codefresh-cm-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: codefresh
subjects:
- kind: ServiceAccount
name: default
2 changes: 1 addition & 1 deletion manifests/argo-cd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
resources:
- https://raw.githubusercontent.com/codefresh-io/argo-cd/release-2.1/manifests/install.yaml
- https://raw.githubusercontent.com/argoproj-labs/applicationset/master/manifests/install.yaml?ref=2c62537a8e5a # TODO: switch to the next release when available

- default-rbac.yaml
images:
- name: quay.io/argoproj/argocd
newName: quay.io/codefresh/argocd
Expand Down
2 changes: 1 addition & 1 deletion manifests/runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: "{{ namespace }}"
spec:
defVersion: 1.0.0
version: 0.0.47
version: 0.0.48
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
components:
- name: events
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (r *Runtime) Save(fs fs.FS, filename string, config *CommonConfig) error {
Kind: "ConfigMap",
},
ObjectMeta: metav1.ObjectMeta{
Name: "codefresh-cm",
Name: store.Get().CodefreshCM,
Namespace: r.Namespace,
Labels: map[string]string{
apstore.Default.LabelKeyAppManagedBy: store.Get().BinaryName,
Expand Down
2 changes: 2 additions & 0 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type Store struct {
EventsReporterName string
WorkflowReporterName string
CodefreshSA string
CodefreshCM string
ComponentsReporterName string
ComponentsReporterSA string
ComponentsReporterURL string
Expand Down Expand Up @@ -82,6 +83,7 @@ func init() {
s.CFRuntimeDefType = "runtimeDef"
s.CFRuntimeType = "runtime"
s.CFTokenSecret = "codefresh-token"
s.CodefreshCM = "codefresh-cm"
s.CFTokenSecretKey = "token"
s.ArgoCDTokenSecret = "argocd-token"
s.ArgoCDTokenKey = "token"
Expand Down

0 comments on commit f95aa68

Please sign in to comment.