Skip to content

Commit 597b2d9

Browse files
dgolovinbenoitf
andauthored
fix: add redhat registry logo (#64)
* fix: add redhat registry logo Signed-off-by: Denis Golovin <[email protected]> * Update registry name to 'Red Hat Container Registry' Co-authored-by: Florent BENOIT <[email protected]> --------- Signed-off-by: Denis Golovin <[email protected]> Co-authored-by: Florent BENOIT <[email protected]>
1 parent 912ebce commit 597b2d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/extension.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ async function getAuthService() {
4949
return authService;
5050
}
5151

52+
// function to encode file data to base64 encoded string
53+
function fileToBase64(file: string) {
54+
// read binary data
55+
var bitmap = readFileSync(file);
56+
// convert binary data to base64 encoded string
57+
return new Buffer(bitmap).toString('base64');
58+
}
59+
5260
function parseJwt (token: string) {
5361
var base64Url = token.split('.')[1];
5462
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
@@ -75,7 +83,9 @@ async function createRegistry(username: string, secret: string, serverUrl: strin
7583
serverUrl,
7684
username,
7785
secret,
78-
source: ''
86+
source: '',
87+
name: 'Red Hat Container Registry',
88+
icon: fileToBase64(path.resolve(__dirname,'..', 'icon.png')),
7989
});
8090
}
8191

0 commit comments

Comments
 (0)