Skip to content

Commit 99b8a34

Browse files
add parsing of the new single namespace var to cm and env var
1 parent 838a43f commit 99b8a34

File tree

11 files changed

+69
-0
lines changed

11 files changed

+69
-0
lines changed

charts/gitops-runtime/templates/_components/cap-app-proxy/_all_resources.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
{{ include "cap-app-proxy.resources.service" . }}
1111
---
1212
{{ include "cap-app-proxy.resources.sa" .}}
13+
---
14+
{{ include "argo-cd.namespaced-rbac.all" . }}
1315
{{- end }}

charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env: {{ .Values.config.env | quote}}
1111
isConfigurationRuntime: {{ .Values.global.runtime.isConfigurationRuntime | quote }}
1212
isExternalArgoCD: {{ .Values.global.runtime.isExternalArgoCD | quote }}
1313
runtimeName: {{ required "global.runtime.name is required" .Values.global.runtime.name | quote}}
14+
runtimeSingleNamespace: {{ .Values.app-proxy.singleNamespace | quote }}
1415
skipGitPermissionValidation: {{ .Values.config.skipGitPermissionValidation | quote }}
1516
logLevel: {{ .Values.config.logLevel | quote }}
1617
{{- $enrichmentValues := get .Values "image-enrichment" }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- include "argo-cd.namespaced-rbac.role" . }}
2+
---
3+
{{- include "argo-cd.namespaced-rbac.rolebinding" . }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.app-proxy.singleNamespace }}
2+
{{- define "argo-cd.namespaced-rbac.role" }}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: Role
5+
metadata:
6+
name: argocd-namespaced-role
7+
namespace: {{ .Release.Namespace }}
8+
labels:
9+
{{- include "codefresh-gitops-runtime.labels" . | nindent 4 }}
10+
codefresh.io/component: argocd-namespaced-rbac
11+
rules:
12+
- apiGroups: [""]
13+
resources: ["pods", "services", "endpoints", "persistentvolumeclaims", "events", "configmaps", "secrets", "serviceaccounts"]
14+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
15+
- apiGroups: ["apps"]
16+
resources: ["deployments", "replicasets", "statefulsets", "daemonsets"]
17+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
18+
- apiGroups: ["batch"]
19+
resources: ["jobs", "cronjobs"]
20+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
21+
- apiGroups: ["networking.k8s.io"]
22+
resources: ["ingresses", "networkpolicies"]
23+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
24+
- apiGroups: ["rbac.authorization.k8s.io"]
25+
resources: ["roles", "rolebindings"]
26+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
27+
{{- end }}
28+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if .Values.app-proxy.singleNamespace }}
2+
{{- define "argo-cd.namespaced-rbac.rolebinding" }}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: RoleBinding
5+
metadata:
6+
name: argocd-namespaced-rolebinding
7+
namespace: {{ .Release.Namespace }}
8+
labels:
9+
{{- include "codefresh-gitops-runtime.labels" . | nindent 4 }}
10+
codefresh.io/component: argocd-namespaced-rbac
11+
roleRef:
12+
apiGroup: rbac.authorization.k8s.io
13+
kind: Role
14+
name: argocd-namespaced-role
15+
subjects:
16+
- kind: ServiceAccount
17+
name: default
18+
namespace: {{ .Release.Namespace }}
19+
{{- end }}
20+
{{- end }}

charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ RUNTIME_NAME:
109109
configMapKeyRef:
110110
name: cap-app-proxy-cm
111111
key: runtimeName
112+
RUNTIME_SINGLE_NAMESPACE:
113+
valueFrom:
114+
configMapKeyRef:
115+
name: cap-app-proxy-cm
116+
key: runtimeSingleNamespace
117+
optional: true
112118
RUNTIME_TOKEN:
113119
valueFrom:
114120
secretKeyRef:
@@ -210,6 +216,7 @@ IRW_JIRA_ENRICHMENT_TASK_IMAGE:
210216
name: cap-app-proxy-cm
211217
key: enrichmentJiraEnrichmentImage
212218
optional: true
219+
213220
NODE_EXTRA_CA_CERTS: /app/config/all/all.cer
214221
{{- if gt (int .Values.replicaCount) 1 }}
215222
LEADER_ID:

charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ COMMIT_STATUS_POLLING_INTERVAL: {{ .Values.config.commitStatusPollingInterval }}
1515
WORKFLOW_MONITOR_POLLING_INTERVAL: {{ .Values.config.workflowMonitorPollingInterval }}
1616
MAX_CONCURRENT_RELEASES: {{ .Values.config.maxConcurrentReleases }}
1717
PROMOTION_WRAPPER_TEMPLATE: {{ .Values.config.promotionWrapperTemplate | quote }}
18+
RUNTIME_SINGLE_NAMESPACE: {{ .Values.app-proxy.singleNamespace }}
1819
{{- end }}
1920

2021
{{- define "gitops-operator.resources.environment-variables.defaults" -}}

charts/gitops-runtime/templates/_components/gitops-operator/crds/_all.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
---
1515
{{- include "gitops-operator.crds.product" $context }}
1616
---
17+
{{- if not .Values.app-proxy.singleNamespace }}
1718
{{- include "gitops-operator.crds.restricted-gitsource" $context }}
19+
{{- end }}
1820
---
1921
{{- include "gitops-operator.crds.promotion-policy" $context }}
2022
{{- end }}

charts/gitops-runtime/templates/_components/gitops-operator/rbac/_all.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
---
1414
{{- include "gitops-operator.resources.leader-election-rbac" $context }}
1515
---
16+
{{- if not .Values.app-proxy.singleNamespace }}
1617
{{- include "gitops-operator.resources.restricted-git-source-rbac" $context }}
18+
{{- end }}
1719
---
1820
{{- include "gitops-operator.resources.rbac-operator" $context }}
1921
{{- end }}

charts/gitops-runtime/templates/codefresh-cm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ data:
1515
ingressController: {{ .Values.global.runtime.ingress.className | default "" | quote }}
1616
ingressHost: {{ include "codefresh-gitops-runtime.ingress-url" . }}
1717
isConfigurationRuntime: {{ .Values.global.runtime.isConfigurationRuntime | quote }}
18+
singleNamespace: {{ .Values.app-proxy.singleNamespace | quote }}
1819
version: {{ .Chart.AppVersion }}

0 commit comments

Comments
 (0)