Files
OpenShell/deploy/helm/openshell/tests/sandbox_namespace_test.yaml
Gaizka MenendezandTaylor Mutch fe3942f2da feat(helm): migrate gateway configuration to gatewayConfig (#3384)
* feat(helm): add generic gateway TOML serializer

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* docs(architecture): define Helm gateway configuration boundary

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* feat(helm): define default gateway configuration map

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): render gateway config from values map

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* test(helm): cover generic gateway TOML rendering

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* feat(helm): protect gateway config secret boundary

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* docs(helm): classify legacy gateway configuration values

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): derive dual-use resources from gateway config

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* test(helm): migrate gateway config scenarios

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): derive credential resources from gateway config

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): migrate gateway config overlays

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): remove gateway configuration shadow values

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* refactor(helm): align runtime config with resources

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* docs(helm): add gateway config migration guide

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* test(helm): validate rendered gateway config

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* test(helm): cover config resource coherence

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): make Kubernetes E2E deployable

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(e2e): pass host aliases through gateway config

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* docs(e2e): reference gateway config host alias

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): enforce gateway resource ownership

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* test(e2e): cover chart host gateway input

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): address gateway config review findings

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): repair RFC 0012 migration integration

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(e2e): align Kubernetes parity with RFC 0012

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): complete gateway config migration

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* chore(helm): add SPDX header to TOML template

* fix(helm): preserve legacy gateway configuration aliases

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): complete legacy gateway config compatibility

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* feat(helm): support gateway config arrays of tables

* fix(helm): preserve sandbox identity aliases

* fix(helm): address gateway config review findings

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>

* fix(helm): preserve gateway config migration settings

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* test(helm): validate extension arrays in CI values

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* fix(helm): restore unconditional SPDX headers

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* fix(helm): restore route SPDX header placement

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* docs(helm): simplify configuration and migration examples

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* docs(helm): remove redundant flag explanations

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

* docs(helm): move chart configuration guidance to Kubernetes setup

Signed-off-by: Taylor Mutch <taylormutch@gmail.com>

---------

Signed-off-by: Gaizka Menendez Hernandez <gmenende@redhat.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Co-authored-by: Taylor Mutch <taylormutch@gmail.com>
2026-10-08 18:39:59 +00:00

160 lines
4.5 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
suite: sandboxNamespace defaulting
templates:
- templates/gateway-config.yaml
- templates/networkpolicy.yaml
- templates/role.yaml
- templates/rolebinding.yaml
- templates/serviceaccount.yaml
release:
name: openshell
namespace: my-namespace
tests:
- it: defaults the Kubernetes driver namespace to release namespace
template: templates/gateway-config.yaml
asserts:
- matchRegex:
path: data["gateway.toml"]
pattern: '(?ms)\[openshell\.drivers\.kubernetes\].*?namespace\s*=\s*"my-namespace"'
- notMatchRegex:
path: data["gateway.toml"]
pattern: 'sandbox_namespace\s*='
- it: uses explicit sandboxNamespace for the Kubernetes driver
template: templates/gateway-config.yaml
set:
server.sandboxNamespace: other-ns
asserts:
- matchRegex:
path: data["gateway.toml"]
pattern: '(?ms)\[openshell\.drivers\.kubernetes\].*?namespace\s*=\s*"other-ns"'
- notMatchRegex:
path: data["gateway.toml"]
pattern: 'sandbox_namespace\s*='
- it: defaults NetworkPolicy namespace to release namespace
template: templates/networkpolicy.yaml
set:
networkPolicy.enabled: true
asserts:
- equal:
path: metadata.namespace
value: my-namespace
- it: uses explicit sandboxNamespace for NetworkPolicy
template: templates/networkpolicy.yaml
set:
networkPolicy.enabled: true
server.sandboxNamespace: other-ns
asserts:
- equal:
path: metadata.namespace
value: other-ns
- it: uses explicit sandboxNamespace for sandbox RBAC
template: templates/role.yaml
set:
server.sandboxNamespace: other-ns
asserts:
- equal:
path: metadata.namespace
value: other-ns
- contains:
path: rules
content:
apiGroups: [""]
resources: ["services"]
verbs: ["create", "get"]
- contains:
path: rules
content:
apiGroups: [""]
resources: ["secrets"]
verbs: ["create", "delete"]
- notContains:
path: rules
content:
apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get"]
- notContains:
path: rules
content:
apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
- notContains:
path: rules
content:
apiGroups: [""]
resources: ["configmaps"]
verbs: ["get"]
- it: grants PVC admission reads only when caller driver config is enabled
template: templates/role.yaml
set:
server.drivers.kubernetes.allowDriverConfig: true
asserts:
- contains:
path: rules
content:
apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get"]
- it: omits shared-workspace resources for the deprecated managed workspace mode
template: templates/role.yaml
set:
server.drivers.kubernetes.workspaceMode: managed
asserts:
- hasDocuments:
count: 0
- it: omits shared-workspace resources for the deprecated operator workspace mode
template: templates/rolebinding.yaml
set:
server.drivers.kubernetes.workspaceMode: operator
asserts:
- hasDocuments:
count: 0
- it: uses explicit sandboxNamespace for sandbox RoleBinding
template: templates/rolebinding.yaml
set:
server.sandboxNamespace: other-ns
asserts:
- equal:
path: metadata.namespace
value: other-ns
- it: uses explicit sandboxNamespace for sandbox ServiceAccount
template: templates/serviceaccount.yaml
set:
server.sandboxNamespace: other-ns
asserts:
- equal:
path: metadata.namespace
value: other-ns
documentIndex: 1
- it: omits workspace resources in gateway-only mode
set:
workspaceResources.enabled: false
networkPolicy.enabled: true
asserts:
- hasDocuments:
count: 1
template: templates/gateway-config.yaml
- hasDocuments:
count: 0
template: templates/networkpolicy.yaml
- hasDocuments:
count: 0
template: templates/role.yaml
- hasDocuments:
count: 0
template: templates/rolebinding.yaml