Skip to content

Commit

Permalink
policy-controller: fix empty values
Browse files Browse the repository at this point in the history
Signed-off-by: walnuts1018 <[email protected]>
  • Loading branch information
walnuts1018 committed Sep 15, 2024
1 parent 5178832 commit 77329e6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ spec:
value: "{{ $value }}"
{{- end }}
{{- end }}
{{- if or (semverCompare ">= 1.8-0" .Chart.AppVersion) .Values.webhook.extraArgs }}
args:
{{- if semverCompare ">= 1.8-0" .Chart.AppVersion }}
- -webhook-name={{ required "A valid cosign.webhookName is required" .Values.cosign.webhookName }}
Expand All @@ -79,6 +80,7 @@ spec:
{{- range $key, $value := .Values.webhook.extraArgs }}
- -{{ $key }}={{ $value }}
{{- end }}
{{- end }}
ports:
- containerPort: 8443
name: https
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- with .Values.annotations }}
annotations:
{{- if .Values.annotations }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- if .Values.webhook.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.webhook.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.webhook.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.webhook.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "policy-controller.selectorLabels" . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
apiVersion: v1
kind: Secret
metadata:
{{- if or .Values.webhook.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.webhook.service.annotations }}
{{ toYaml .Values.webhook.service.annotations | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- toYaml .Values.commonAnnotations | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- include "policy-controller.labels" . | nindent 4 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
name: webhook-certs
namespace: {{ .Release.Namespace }}
# The data is populated at install time.
# The data is populated at install time.
12 changes: 6 additions & 6 deletions charts/policy-controller/templates/webhook/service_webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: Service
metadata:
{{- with .Values.webhook.service.annotations }}
annotations:
{{- if .Values.webhook.service.annotations }}
{{ toYaml .Values.webhook.service.annotations | nindent 4 }}
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "policy-controller.labels" . | nindent 4 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
Expand All @@ -27,10 +27,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
{{- with .Values.webhook.service.annotations }}
annotations:
{{- if .Values.webhook.service.annotations }}
{{ toYaml .Values.webhook.service.annotations | nindent 4 }}
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "policy-controller.labels" . | nindent 4 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
Expand Down

0 comments on commit 77329e6

Please sign in to comment.