From 0ab0c0ca08481cec1de96234718bc51eac72f49f Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 31 May 2024 08:06:49 +0200 Subject: [PATCH] fix: podman login into external registries (#1120) Signed-off-by: Anatolii Bazko --- .../src/devworkspaceClient/services/__tests__/podmanApi.spec.ts | 2 +- .../src/devworkspaceClient/services/podmanApi.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podmanApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podmanApi.spec.ts index 80c7a1dff..28cafaf7c 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podmanApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podmanApi.spec.ts @@ -73,7 +73,7 @@ describe('podman Config API Service', () => { 'sh', '-c', expect.stringContaining( - 'podman login registry1 -u user1 -p password1 || true\npodman login registry2 -u user2 -p password2 || true', + "podman login registry1 -u 'user1' -p 'password1' || true\npodman login registry2 -u 'user2' -p 'password2' || true", ), ]), expect.anything(), diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts index 2cdeea683..3f091d8f7 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts @@ -176,7 +176,7 @@ export class PodmanApiService implements IPodmanApi { if (username && password) { // `|| true` ensures that `podman login` won't fail if credentials are invalid - externalDockerRegistriesPodmanLoginCommand += `podman login ${registry} -u ${username} -p ${password} || true\n`; + externalDockerRegistriesPodmanLoginCommand += `podman login ${registry} -u '${username}' -p '${password}' || true\n`; } } }