Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion deploy/helm/openshell/templates/_gateway-workload.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ spec:
- host.docker.internal
- host.openshell.internal
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
containers:
- name: openshell-gateway
securityContext:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

suite: gateway pod securityContext
templates:
- templates/gateway-config.yaml
- templates/statefulset.yaml
release:
name: openshell
namespace: my-namespace

tests:
- it: renders the pod securityContext from podSecurityContext by default
template: templates/statefulset.yaml
asserts:
- equal:
path: spec.template.spec.securityContext.fsGroup
value: 1000

- it: renders an explicitly set podSecurityContext
template: templates/statefulset.yaml
set:
podSecurityContext:
fsGroup: 2000
asserts:
- equal:
path: spec.template.spec.securityContext.fsGroup
value: 2000

- it: omits the pod securityContext block when podSecurityContext is null
template: templates/statefulset.yaml
set:
podSecurityContext: null
asserts:
- notExists:
path: spec.template.spec.securityContext
Loading