1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 05:49:40 +02:00

feat(endpoints): enable env vars on kube edge deploy [EE-2542] (#6620)

This commit is contained in:
Chaim Lev-Ari 2022-04-17 10:34:20 +03:00 committed by GitHub
parent da9ef7dfcf
commit 7efdae5eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 19 deletions

View file

@ -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(