From 7efdae5eeef888ccc629b9bc7807ff401135e6e5 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Sun, 17 Apr 2022 10:34:20 +0300 Subject: [PATCH] feat(endpoints): enable env vars on kube edge deploy [EE-2542] (#6620) --- .../EdgeScriptForm/EdgePropertiesForm.tsx | 28 +++++++++---------- .../components/EdgeScriptForm/Scripts.tsx | 10 ++++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/edge/components/EdgeScriptForm/EdgePropertiesForm.tsx b/app/edge/components/EdgeScriptForm/EdgePropertiesForm.tsx index 622631ea1..6c82fae0c 100644 --- a/app/edge/components/EdgeScriptForm/EdgePropertiesForm.tsx +++ b/app/edge/components/EdgeScriptForm/EdgePropertiesForm.tsx @@ -55,21 +55,19 @@ export function EdgePropertiesForm({ - {values.platform !== 'k8s' && ( - - setFieldValue(e.target.name, e.target.value)} - /> - - )} + + setFieldValue(e.target.name, e.target.value)} + /> + ); } diff --git a/app/edge/components/EdgeScriptForm/Scripts.tsx b/app/edge/components/EdgeScriptForm/Scripts.tsx index 96fb653e6..ccf7bd561 100644 --- a/app/edge/components/EdgeScriptForm/Scripts.tsx +++ b/app/edge/components/EdgeScriptForm/Scripts.tsx @@ -262,7 +262,7 @@ function buildKubernetesCommand( edgeIdScript: string, edgeKey: string, allowSelfSignedCerts: boolean, - _envVars: string, + envVars: string, edgeId?: string, agentSecret = '' ) { @@ -270,11 +270,13 @@ function buildKubernetesCommand( const idEnvVar = edgeIdScript ? `PORTAINER_EDGE_ID=$(${edgeIdScript}) \n\n` : ''; + const edgeIdVar = !edgeIdScript && edgeId ? edgeId : '$PORTAINER_EDGE_ID'; + const selfSigned = allowSelfSignedCerts ? '1' : '0'; return `${idEnvVar}curl https://downloads.portainer.io/ce${agentShortVersion}/portainer-edge-agent-setup.sh | - bash -s -- "${ - !edgeIdScript && edgeId ? edgeId : '$PORTAINER_EDGE_ID' - }" "${edgeKey}" "${allowSelfSignedCerts ? '1' : '0'}" "${agentSecret}"`; + bash -s -- "${edgeIdVar}" \\ + "${edgeKey}" \\ + "${selfSigned}" "${agentSecret}" "${envVars}"`; } function buildDefaultEnvVars(