Skip to content

Commit

Permalink
Merge pull request #835 from walnuts1018/fix-empty-values
Browse files Browse the repository at this point in the history
policy-controller: fix empty values
  • Loading branch information
bobcallaway authored Oct 25, 2024
2 parents e88db0e + aec2e92 commit 996820b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/policy-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sources:
type: application

name: policy-controller
version: 0.7.0
version: 0.7.1
appVersion: 0.8.2

maintainers:
Expand Down
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 996820b

Please sign in to comment.