Skip to content

Commit 86f0228

Browse files
authored
fix: use correct securityContext for Alpine based helm-repository Pod (#955)
**What problem does this PR solve?**: User `65532` is the default UID in distroless based images, but in Alpine it's a different user and group. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
1 parent fb5a68a commit 86f0228

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
3535
| helmRepositoryImage.pullPolicy | string | `"IfNotPresent"` | |
3636
| helmRepositoryImage.repository | string | `"ghcr.io/nutanix-cloud-native/caren-helm-reg"` | |
3737
| helmRepositoryImage.tag | string | `""` | |
38+
| helmRepositorySecurityContext.fsGroup | int | `65534` | |
39+
| helmRepositorySecurityContext.runAsGroup | int | `65534` | |
40+
| helmRepositorySecurityContext.runAsUser | int | `65534` | |
3841
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
3942
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-aws-ccm-helm-values-template"` | |
4043
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.27" | string | `"v1.27.9"` | |

charts/cluster-api-runtime-extensions-nutanix/templates/helm-repository.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ spec:
101101
periodSeconds: 1
102102
priorityClassName: {{ .Values.priorityClassName }}
103103
securityContext:
104-
{{ with .Values.securityContext }}
104+
{{ with .Values.helmRepositorySecurityContext }}
105105
{{- toYaml . | nindent 8}}
106106
{{- end }}
107107
volumes:

charts/cluster-api-runtime-extensions-nutanix/values.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252
},
5353
"type": "object"
5454
},
55+
"helmRepositorySecurityContext": {
56+
"properties": {
57+
"fsGroup": {
58+
"type": "integer"
59+
},
60+
"runAsGroup": {
61+
"type": "integer"
62+
},
63+
"runAsUser": {
64+
"type": "integer"
65+
}
66+
},
67+
"type": "object"
68+
},
5569
"hooks": {
5670
"properties": {
5771
"ccm": {

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,16 @@ resources:
156156
requests:
157157
cpu: 100m
158158
memory: 128Mi
159+
159160
securityContext:
160161
runAsUser: 65532
162+
163+
# The helm-repository containers are based on an Alpine image with a different nonroot user
164+
helmRepositorySecurityContext:
165+
runAsUser: 65534
166+
runAsGroup: 65534
167+
fsGroup: 65534
168+
161169
service:
162170
annotations: {}
163171
type: ClusterIP

0 commit comments

Comments
 (0)