Skip to content

Commit

Permalink
fix: pull request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patricktalmeida committed Sep 20, 2023
1 parent ee4b096 commit be55368
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
11 changes: 11 additions & 0 deletions charts/kor/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "kor.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
2 changes: 2 additions & 0 deletions charts/kor/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
args: ["{{ .Values.cronJob.command }} --slack-webhook-url {{ .Values.cronJob.slackWebhookUrl }}"]
{{- else if and .Values.cronJob.slackChannel .Values.cronJob.slackAuthToken }}
args: ["{{ .Values.cronJob.command }} --slack-channel {{ .Values.cronJob.slackChannel }} --slack-auth-token {{ .Values.cronJob.slackAuthToken }}"]
{{- else }}
args: ["{{ .Values.cronJob.command }}"]
{{- end }}
{{- if .Values.cronJob.env }}
env:
Expand Down
1 change: 0 additions & 1 deletion charts/kor/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "kor.serviceAccountName" . }}-read-resources-role
namespace: {{ .Values.namespace }}
rules:
- apiGroups: ["*"]
resources:
Expand Down
4 changes: 1 addition & 3 deletions charts/kor/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "kor.serviceAccountName" . }}-read-resources-role-binding
namespace: {{ .Values.namespace }}
subjects:
- kind: ServiceAccount
name: {{ include "kor.serviceAccountName" . }}
namespace: {{ .Values.namespace }}
roleRef:
kind: Role
name: {{ include "kor.serviceAccountName" . }}-read-resources-role
Expand All @@ -20,7 +18,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: {{ include "kor.serviceAccountName" . }}
namespace: {{ .Values.namespace }}
namespace: {{ include "kor.namespace" . }}
roleRef:
kind: ClusterRole
name: {{ include "kor.serviceAccountName" . }}-read-resources-clusterrole
Expand Down
2 changes: 0 additions & 2 deletions charts/kor/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace: kor

cronJob:
enabled: true
name: kor
Expand Down

0 comments on commit be55368

Please sign in to comment.