From 285cc70f1cbdc975a2134428ad83178ef9c821a4 Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Thu, 14 Oct 2021 14:44:06 +0200 Subject: [PATCH] set apiServer of the target for garden terminals --- backend/lib/services/terminals/index.js | 7 ++++--- .../acceptance/__snapshots__/api.terminals.spec.js.snap | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/lib/services/terminals/index.js b/backend/lib/services/terminals/index.js index 0e9a18e45b..2b866ad756 100644 --- a/backend/lib/services/terminals/index.js +++ b/backend/lib/services/terminals/index.js @@ -209,6 +209,10 @@ async function getTargetCluster ({ user, namespace, name, target, preferredHost, switch (target) { case TargetEnum.GARDEN: { targetCluster.kubeconfigContextNamespace = namespace + targetCluster.apiServer = { + server: config.apiServerUrl + } + if (isAdmin) { targetCluster.namespace = 'garden' targetCluster.credentials = getConfigValue('terminal.garden.operatorCredentials') @@ -244,9 +248,6 @@ async function getTargetCluster ({ user, namespace, name, target, preferredHost, ] } ] - targetCluster.apiServer = { - server: config.apiServerUrl - } } break diff --git a/backend/test/acceptance/__snapshots__/api.terminals.spec.js.snap b/backend/test/acceptance/__snapshots__/api.terminals.spec.js.snap index d6f2c4225b..9289aad22b 100644 --- a/backend/test/acceptance/__snapshots__/api.terminals.spec.js.snap +++ b/backend/test/acceptance/__snapshots__/api.terminals.spec.js.snap @@ -408,7 +408,9 @@ Array [ "temporaryNamespace": true, }, "target": Object { - "apiServer": undefined, + "apiServer": Object { + "server": "https://kubernetes.external.foo.bar", + }, "authorization": Object { "projectMemberships": undefined, "roleBindings": Array [