Skip to content

fix(helm): omit podSecurityContext block when value is null - #3034

Open
jgarciao wants to merge 1 commit into
NVIDIA:mainfrom
jgarciao:fix/3033-helm-podsecuritycontext-null
Open

fix(helm): omit podSecurityContext block when value is null#3034
jgarciao wants to merge 1 commit into
NVIDIA:mainfrom
jgarciao:fix/3033-helm-podsecuritycontext-null

Conversation

@jgarciao

Copy link
Copy Markdown
Contributor

Summary

The gateway pod template rendered securityContext: unconditionally, so setting podSecurityContext: null produced securityContext: null instead of omitting the block. This wraps the block in {{- with .Values.podSecurityContext }} so a null value omits it cleanly — the supported way to let OpenShift's SCC assign the UID/GID range — while an explicit value renders unchanged.

Related Issue

Fixes #3033

Changes

  • deploy/helm/openshell/templates/_gateway-workload.tpl: guard the pod-level securityContext block with {{- with .Values.podSecurityContext }} so a null value omits it.
  • deploy/helm/openshell/tests/gateway_pod_security_context_test.yaml: new helm-unittest suite covering the default (fsGroup: 1000), an explicit override, and the null-omission case.

Testing

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable) — n/a

The gateway pod template rendered `securityContext:` unconditionally, so
setting `podSecurityContext: null` (e.g. to let OpenShift's SCC assign the
UID/GID range) produced `securityContext: null` instead of omitting the
block. Wrap the block in `{{- with .Values.podSecurityContext }}` so a null
value omits it and an explicit value renders unchanged.

Add a helm-unittest suite covering the default, explicit, and null cases.

Fixes NVIDIA#3033

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(helm): omit podSecurityContext block when value is null

1 participant