Skip to content

Commit

Permalink
fix: Revert to use of jason
Browse files Browse the repository at this point in the history
PR should work whe when/if PR to update docker-modem to 3.0.8 released

Signed-off-by: Denis Golovin <[email protected]>
  • Loading branch information
dgolovin committed Jul 13, 2023
1 parent 20fdd8a commit 8cf7481
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"dependencies": {
"@kubernetes/client-node": "^0.18.1",
"@podman-desktop/api": "^1.1.0",
"base64url": "^3.0.1",
"fs-extra": "^10.1.0",
"got": "^12.6.0",
"js-yaml": "^4.1.0"
Expand Down
16 changes: 1 addition & 15 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import { KubeConfig } from '@kubernetes/client-node';
import * as extensionApi from '@podman-desktop/api';
import base64url from 'base64url';
import got from 'got';
import * as kubeconfig from './kubeconfig';

Expand Down Expand Up @@ -152,20 +151,7 @@ export async function pushImageToOpenShiftRegistry(image: ImageInfo): Promise<vo
resolve(undefined);
}
},
// To work correctly docker-modem >v3.0.3 should be used to encode auth config using base64url
// Upgrading docker-modem to required version leads to segfaut during the build
// { username: registryInfo.username, password: registryInfo.token, serveraddress: registryInfo.host },

// Manual encoding required to avoid image push error for
{
base64: base64url(
JSON.stringify({
username: registryInfo.username,
password: registryInfo.token,
serveraddress: registryInfo.host,
}),
),
} as any as extensionApi.AuthConfig,
{ username: registryInfo.username, password: registryInfo.token, serveraddress: registryInfo.host },
);
} catch (err: unknown) {
reject(err);
Expand Down
11 changes: 3 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@
openid-client "^5.3.0"

"@podman-desktop/api@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@podman-desktop/api/-/api-1.1.0.tgz#b1f6441cf68cda03bce1030ef9622168b397a50a"
integrity sha512-hwoPZjLkT1fIMG2IXkTSwK1Xnl381/YfM0vEQHXsT2pA36j8MiloOn4PeoCynk+wZPO5jLJUccOS7WFrqC5xeg==
version "1.2.0"
resolved "https://registry.yarnpkg.com/@podman-desktop/api/-/api-1.2.0.tgz#45bad164c176006f335be0ff265762d48202f23e"
integrity sha512-kTMGuSpGjSesQg8qw/fya9dCm6Tk9/X7nfEERPXNw0J+5UMwlsmvgB/zf1/jvzwQRfeFxI/l6QxhS0BXPb0fkA==

"@sindresorhus/is@^5.2.0":
version "5.3.0"
Expand Down Expand Up @@ -286,11 +286,6 @@ balanced-match@^1.0.0:
resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==

base64url@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d"
integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==

bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"
Expand Down

0 comments on commit 8cf7481

Please sign in to comment.