File tree Expand file tree Collapse file tree
openshell-workspace/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
3838Validate required cross-namespace gateway identity values.
3939*/ }}
4040{{- define " openshell-workspace.validateValues" -}}
41- {{- required " gateway.serviceAccount.name is required" .Values.gateway.serviceAccount.name -}}
42- {{- required " gateway.serviceAccount.namespace is required" .Values.gateway.serviceAccount.namespace -}}
43- {{- required " sandboxServiceAccount.name is required" .Values.sandboxServiceAccount.name -}}
41+ {{- $gatewayServiceAccountName := required " gateway.serviceAccount.name is required" .Values.gateway.serviceAccount.name -}}
42+ {{- $gatewayServiceAccountNamespace := required " gateway.serviceAccount.namespace is required" .Values.gateway.serviceAccount.namespace -}}
43+ {{- $sandboxServiceAccountName := required " sandboxServiceAccount.name is required" .Values.sandboxServiceAccount.name -}}
4444{{- end }}
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- {{- include "openshell-workspace.validateValues" . - }}
4+ {{- include "openshell-workspace.validateValues" . }}
55{{- if .Values.networkPolicy.enabled }}
66apiVersion : networking.k8s.io/v1
77kind : NetworkPolicy
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- {{- include "openshell-workspace.validateValues" . - }}
4+ {{- include "openshell-workspace.validateValues" . }}
55apiVersion : rbac.authorization.k8s.io/v1
66kind : Role
77metadata :
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- {{- include "openshell-workspace.validateValues" . - }}
4+ {{- include "openshell-workspace.validateValues" . }}
55apiVersion : rbac.authorization.k8s.io/v1
66kind : RoleBinding
77metadata :
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- {{- include "openshell-workspace.validateValues" . - }}
4+ {{- include "openshell-workspace.validateValues" . }}
55{{- if .Values.sandboxServiceAccount.create }}
66apiVersion : v1
77kind : ServiceAccount
Original file line number Diff line number Diff line change @@ -70,6 +70,19 @@ Create the name of the service account assigned to sandbox pods
7070{{- end }}
7171{{- end }}
7272
73+ {{/*
74+ Whether this chart owns workspace-scoped resources. Missing legacy values
75+ default to enabled so upgrades with --reuse-values preserve the old topology.
76+ */ }}
77+ {{- define " openshell.workspaceResourcesEnabled" -}}
78+ {{- $workspaceResources := .Values.workspaceResources | default dict -}}
79+ {{- $enabled := true -}}
80+ {{- if hasKey $workspaceResources " enabled" -}}
81+ {{- $enabled = get $workspaceResources " enabled" -}}
82+ {{- end -}}
83+ {{- if $enabled -}}true{{- end -}}
84+ {{- end }}
85+
7386{{/*
7487Gateway image reference. Uses image.tag when set; falls back to .Chart.AppVersion
7588so a released chart automatically pulls the matching image without extra overrides.
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- {{- if and .Values.workspaceResources.enabled .Values.networkPolicy.enabled }}
4+ {{- if and (include "openshell.workspaceResourcesEnabled" .) .Values.networkPolicy.enabled }}
55# NetworkPolicy restricting SSH ingress on sandbox pods to the gateway pod.
66# Sandbox pods are dynamically created by the server and labelled with
77# openshell.ai/managed-by=openshell. This policy ensures only the gateway
Original file line number Diff line number Diff line change 11{{- $workspaceMode := .Values.server.drivers.kubernetes.workspaceMode | default "shared" -}}
2- {{- if and (eq $workspaceMode "shared") .Values.workspaceResources.enabled }}
2+ {{- if and (eq $workspaceMode "shared") (include "openshell.workspaceResourcesEnabled" .) }}
33# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44# SPDX-License-Identifier: Apache-2.0
55apiVersion : rbac.authorization.k8s.io/v1
Original file line number Diff line number Diff line change 11{{- $workspaceMode := .Values.server.drivers.kubernetes.workspaceMode | default "shared" -}}
2- {{- if and (eq $workspaceMode "shared") .Values.workspaceResources.enabled }}
2+ {{- if and (eq $workspaceMode "shared") (include "openshell.workspaceResourcesEnabled" .) }}
33# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44# SPDX-License-Identifier: Apache-2.0
55apiVersion : rbac.authorization.k8s.io/v1
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ metadata:
1313 {{- toYaml . | nindent 4 }}
1414 {{- end }}
1515{{- end }}
16- {{- if and .Values.serviceAccount.create .Values.workspaceResources.enabled .Values.sandboxServiceAccount.create }}
16+ {{- if and .Values.serviceAccount.create (include "openshell.workspaceResourcesEnabled" .) .Values.sandboxServiceAccount.create }}
1717---
1818{{- end }}
19- {{- if and .Values.workspaceResources.enabled .Values.sandboxServiceAccount.create }}
19+ {{- if and (include "openshell.workspaceResourcesEnabled" .) .Values.sandboxServiceAccount.create }}
2020apiVersion : v1
2121kind : ServiceAccount
2222metadata :
You can’t perform that action at this time.
0 commit comments