From 47934d1cc2e1d19c4feeb102d2f8ab83fc48d1b3 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 3 Nov 2026 12:45:16 +0100 Subject: [PATCH] fix: saving an orchestrator terminal connection wipes policy settings made in Terminals (#33617) Opening an orchestrator terminal connection in Admin Settings > Integrations and clicking Save overwrote its policy in Terminals with only the fields the dialog shows (image, CPU, memory, storage, idle timeout and environment variables). Everything else set in Terminals, like restricted mode or the pod and container security settings, was lost, so new terminals started without it. Saving now keeps the policy settings the dialog does not show and only updates the ones it shows. Fixes #33580 --- .../components/AddTerminalServerModal.svelte | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/components/AddTerminalServerModal.svelte b/src/lib/components/AddTerminalServerModal.svelte index f72796a14c..7c3f6d1486 100644 --- a/src/lib/components/AddTerminalServerModal.svelte +++ b/src/lib/components/AddTerminalServerModal.svelte @@ -63,6 +63,7 @@ let policyStorage = 'ephemeral'; let policyStorageSize = '5Gi'; let policyIdleTimeout = 30; + let loadedPolicyData: Record = {}; let lifecycleJson = '{}'; let refreshOnlyIdle = true; let refreshReset = false; @@ -123,6 +124,7 @@ // Restore resources policyCpu = p.cpu_limit ?? '1'; policyMemory = p.memory_limit ?? '1Gi'; + loadedPolicyData = {}; lifecycleJson = stringifyJson({}); refreshOnlyIdle = true; refreshReset = false; @@ -151,6 +153,7 @@ policyStorage = 'ephemeral'; policyStorageSize = '5Gi'; policyIdleTimeout = 30; + loadedPolicyData = {}; lifecycleJson = '{}'; refreshOnlyIdle = true; refreshReset = false; @@ -180,6 +183,7 @@ auth_type ); const data = policy?.data ?? {}; + loadedPolicyData = data; policyImage = data.image ?? ''; policyIdleTimeout = data.idle_timeout_minutes ?? 30; policyStorage = data.storage ? 'persistent' : 'ephemeral'; @@ -275,7 +279,18 @@ }; const buildPolicyData = (): object => { - const data: Record = {}; + // Keep fields the form does not edit; the orchestrator replaces the whole policy + const data: Record = { ...loadedPolicyData }; + for (const key of [ + 'image', + 'cpu_limit', + 'memory_limit', + 'storage', + 'idle_timeout_minutes', + 'env' + ]) { + delete data[key]; + } if (policyImage) data.image = policyImage; if (policyCpu) data.cpu_limit = policyCpu;