-
Notifications
You must be signed in to change notification settings - Fork 27
Allow Access Operator deploy to a single Namespace or multiple Namespaces #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5bc97ba
27aa933
e2298d4
5b136fd
5d36651
b2ce8a1
9f6177b
c4898f1
936a00a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| {{- if .Values.watchAnyNamespace }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the file named RoleBinding when it contains a ClusterRoleBinding? |
||
| metadata: | ||
| name: strimzi-access-operator | ||
| labels: | ||
| app: strimzi-access-operator | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: strimzi-access-operator | ||
| namespace: {{ .Release.Namespace }} | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: strimzi-access-operator | ||
| apiGroup: rbac.authorization.k8s.io | ||
| {{- else }} | ||
| {{- $namespaces := list }} | ||
| {{- if .Values.watchNamespaces }} | ||
| {{- if kindIs "slice" .Values.watchNamespaces }} | ||
| {{- $namespaces = .Values.watchNamespaces }} | ||
| {{- else }} | ||
| {{- $namespaces = list .Values.watchNamespaces }} | ||
| {{- end }} | ||
| {{- else }} | ||
| {{- $namespaces = list .Release.Namespace }} | ||
| {{- end }} | ||
| {{- range $namespaces }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: strimzi-access-operator | ||
| namespace: {{ . }} | ||
| labels: | ||
| app: strimzi-access-operator | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: strimzi-access-operator | ||
| namespace: {{ $.Release.Namespace }} | ||
| roleRef: | ||
| kind: ClusterRole | ||
| name: strimzi-access-operator | ||
| apiGroup: rbac.authorization.k8s.io | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {{/* | ||
| Generate the watch namespaces list for STRIMZI_NAMESPACE environment variable | ||
| */}} | ||
| {{- define "strimzi.watchNamespacesList" -}} | ||
| {{- if .Values.watchNamespaces }} | ||
| {{- if eq .Values.watchNamespaces "*" }} | ||
| * | ||
| {{- else if kindIs "slice" .Values.watchNamespaces }} | ||
| {{- join "," .Values.watchNamespaces }} | ||
| {{- else }} | ||
| {{- .Values.watchNamespaces }} | ||
| {{- end }} | ||
| {{- else }} | ||
| {{- .Release.Namespace }} | ||
| {{- end }} | ||
| {{- end -}} |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FMPOV you should not have multiple files containing RoleBinding for each Namespace - similarly to the Cluster Operator (and what we have in docs) you can just have one and if needed, it can be created in every Namespace the operator will watch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does called
configuration.settingNamespaces("*")really work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's why I had previous comment(s) about adding the
watchingAllNamespaces().