diff --git a/Makefile b/Makefile index e65f57ab6..7511fe367 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.0.47 +VERSION=v0.0.48 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/runtime.go b/cmd/commands/runtime.go index 8f972d76c..e1b8e7f72 100644 --- a/cmd/commands/runtime.go +++ b/cmd/commands/runtime.go @@ -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) } diff --git a/docs/releases/release_notes.md b/docs/releases/release_notes.md index b8098ed78..b4fd49d2b 100644 --- a/docs/releases/release_notes.md +++ b/docs/releases/release_notes.md @@ -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 @@ -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 diff --git a/manifests/argo-cd/default-rbac.yaml b/manifests/argo-cd/default-rbac.yaml new file mode 100644 index 000000000..e877f382b --- /dev/null +++ b/manifests/argo-cd/default-rbac.yaml @@ -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 \ No newline at end of file diff --git a/manifests/argo-cd/kustomization.yaml b/manifests/argo-cd/kustomization.yaml index 11be8f517..8c645da85 100644 --- a/manifests/argo-cd/kustomization.yaml +++ b/manifests/argo-cd/kustomization.yaml @@ -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 diff --git a/manifests/runtime.yaml b/manifests/runtime.yaml index c71e1e6e4..2916048c7 100644 --- a/manifests/runtime.yaml +++ b/manifests/runtime.yaml @@ -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 diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index 049c2c88a..4048f705f 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -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, diff --git a/pkg/store/store.go b/pkg/store/store.go index 451203b43..e8dde74ff 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -55,6 +55,7 @@ type Store struct { EventsReporterName string WorkflowReporterName string CodefreshSA string + CodefreshCM string ComponentsReporterName string ComponentsReporterSA string ComponentsReporterURL string @@ -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"