Skip to content

Commit

Permalink
Use operator.fullname template rather than .Release.Name (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightkr authored Jul 6, 2022
1 parent a9398fa commit 2b73b32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion template/deploy/helm/[[operator]]/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ data:
{{ (.Files.Glob "configs/*").AsConfig | indent 2 }}
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
name: {{ include "operator.fullname" . }}-configmap
labels:
{{- include "operator.labels" . | nindent 4 }}
10 changes: 5 additions & 5 deletions template/deploy/helm/[[operator]]/templates/deployment.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-deployment
name: {{ include "operator.fullname" . }}-deployment
labels:
{{- include "operator.labels" . | nindent 4 }}
spec:
Expand All @@ -27,7 +27,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Release.Name }}-serviceaccount
serviceAccountName: {{ include "operator.fullname" . }}-serviceaccount
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -44,17 +44,17 @@ spec:
{[% if operator.product_string in ['kafka'] %}]
env:
- name: KAFKA_BROKER_CLUSTERROLE
value: {{ .Release.Name }}-kafka-broker-clusterrole
value: {{ include "operator.fullname" . }}-kafka-broker-clusterrole
{[% endif %}]
{[% if operator.product_string in ['opa'] %}]
env:
- name: OPA_BUNDLE_BUILDER_CLUSTERROLE
value: {{ .Release.Name }}-opa-bundle-builder-clusterrole
value: {{ include "operator.fullname" . }}-opa-bundle-builder-clusterrole
{[% endif %}]
volumes:
- name: config-spec
configMap:
name: {{ .Release.Name }}-configmap
name: {{ include "operator.fullname" . }}-configmap
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-serviceaccount
name: {{ include "operator.fullname" . }}-serviceaccount
labels:
{{- include "operator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand All @@ -15,15 +15,15 @@ apiVersion: rbac.authorization.k8s.io/v1
# This cluster role binding allows anyone in the "manager" group to read secrets in any namespace.
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-clusterrolebinding
name: {{ include "operator.fullname" . }}-clusterrolebinding
labels:
{{- include "operator.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-serviceaccount
name: {{ include "operator.fullname" . }}-serviceaccount
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name }}-clusterrole
name: {{ include "operator.fullname" . }}-clusterrole
apiGroup: rbac.authorization.k8s.io
{{- end }}

0 comments on commit 2b73b32

Please sign in to comment.