Skip to content

Commit

Permalink
add custom labels
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Fernandez <[email protected]>
  • Loading branch information
hectorj2f committed Nov 28, 2023
1 parent 504be94 commit 783843c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 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.6.5
version: 0.6.6
appVersion: 0.8.2

maintainers:
Expand Down
1 change: 1 addition & 0 deletions charts/policy-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The Helm chart for Policy Controller
| webhook.serviceAccount.name | string | `""` | |
| webhook.volumeMounts | list | `[]` | |
| webhook.volumes | list | `[]` | |
| webhook.customLabels | list | `[]` | |
| leasescleanup.image.pullPolicy | string | `"IfNotPresent"` | |
| leasescleanup.image.repository | string | `"cgr.dev/chainguard/kubectl"` | |
| leasescleanup.image.version | string | `"latest-dev"` | `"NOTE: use latest-dev tag because leases cleanup job needs /bin/sh, not present in latest tag"` |
Expand Down
5 changes: 5 additions & 0 deletions charts/policy-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ helm.sh/chart: {{ include "policy-controller.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.webhook.customLabels -}}
{{- range $key, $val := .Values.webhook.customLabels }}
{{ $key }}: {{ $val | quote }}
{{- end}}
{{- end }}
{{- end }}

{{/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
labels:
{{- include "policy-controller.selectorLabels" . | nindent 8 }}
control-plane: {{ template "policy-controller.fullname" . }}-webhook
{{- include "policy-controller.labels" . | nindent 8 }}
spec:
nodeSelector:
{{- toYaml .Values.commonNodeSelector | nindent 8 }}
Expand Down
20 changes: 17 additions & 3 deletions charts/policy-controller/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"commonAnnotations": {
"type": "object"
},
"commonNodeSelector": {
"type": "object"
},
"commonTolerations": {
"type": "array"
},
"commonAnnotations": {
"type": "object"
},
"cosign": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -61,6 +61,9 @@
"configData": {
"type": "object"
},
"customLabels": {
"type": "array"
},
"env": {
"type": "object"
},
Expand Down Expand Up @@ -112,6 +115,17 @@
}
}
},
"podDisruptionBudget": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"minAvailable": {
"type": "integer"
}
}
},
"podSecurityContext": {
"type": "object",
"properties": {
Expand Down
1 change: 1 addition & 0 deletions charts/policy-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ installCRDs: true
imagePullSecrets: []

webhook:
customLabels: []
configData: {}
replicaCount: 1
name: webhook
Expand Down

0 comments on commit 783843c

Please sign in to comment.