Skip to content

Commit

Permalink
feat: add optional automountServiceAccountToken to cleanup job
Browse files Browse the repository at this point in the history
Signed-off-by: falcorocks <[email protected]>
  • Loading branch information
falcorocks committed Feb 14, 2025
1 parent fa464e7 commit 54b3961
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/policy-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ helm uninstall [RELEASE_NAME]
| cosign.webhookTimeoutSeconds | object | `{}` | |
| imagePullSecrets | list | `[]` | |
| installCRDs | bool | `true` | |
| leasescleanup.automountServiceAccountToken | bool | `true` | |
| leasescleanup.image.pullPolicy | string | `"IfNotPresent"` | |
| leasescleanup.image.repository | string | `"cgr.dev/chainguard/kubectl"` | |
| leasescleanup.image.version | string | `"latest-dev"` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ spec:
name: leases-cleanup
spec:
serviceAccountName: {{ template "webhook.serviceAccountName" . }}-cleanup
{{- if .Values.leasescleanup.automountServiceAccountToken }}
automountServiceAccountToken: true
{{- else }}
automountServiceAccountToken: false
{{- end }}
containers:
- name: kubectl
image: "{{ template "leases-cleanup.image" .Values.leasescleanup.image }}"
Expand Down
6 changes: 6 additions & 0 deletions charts/policy-controller/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
},
"leasescleanup": {
"properties": {
"automountServiceAccountToken": {
"default": true,
"required": [],
"title": "automountServiceAccountToken",
"type": "boolean"
},
"image": {
"properties": {
"pullPolicy": {
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 @@ -106,6 +106,7 @@ leasescleanup:
# capabilities:
# drop:
# - ALL
automountServiceAccountToken: true

## common node selector for all the pods
commonNodeSelector: {}
Expand Down

0 comments on commit 54b3961

Please sign in to comment.