|
16 | 16 | * SPDX-License-Identifier: Apache-2.0
|
17 | 17 | ***********************************************************************/
|
18 | 18 |
|
19 |
| -import { readFileSync } from 'node:fs'; |
20 |
| -import path from 'node:path'; |
21 |
| - |
22 | 19 | import * as extensionApi from '@podman-desktop/api';
|
23 | 20 | import type { ServiceAccountV1 } from '@redhat-developer/rhcra-client';
|
24 | 21 | import { ContainerRegistryAuthorizerClient } from '@redhat-developer/rhcra-client';
|
25 | 22 | import { SubscriptionManagerClient } from '@redhat-developer/rhsm-client';
|
26 | 23 |
|
| 24 | +import icon from '../icon.png'; |
27 | 25 | import { onDidChangeSessions, RedHatAuthenticationService } from './authentication-service';
|
28 | 26 | import { getAuthConfig } from './configuration';
|
29 | 27 | import {
|
@@ -55,14 +53,6 @@ async function getAuthenticationService(): Promise<RedHatAuthenticationService>
|
55 | 53 | return authenticationServicePromise;
|
56 | 54 | }
|
57 | 55 |
|
58 |
| -// function to encode file data to base64 encoded string |
59 |
| -function fileToBase64(file: string): string { |
60 |
| - // read binary data |
61 |
| - const bitmap = readFileSync(file); |
62 |
| - // convert binary data to base64 encoded string |
63 |
| - return bitmap.toString('base64'); |
64 |
| -} |
65 |
| - |
66 | 56 | function parseJwt(token: string): JwtToken {
|
67 | 57 | const base64Url = token.split('.')[1];
|
68 | 58 | const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
@@ -322,7 +312,7 @@ export async function activate(context: extensionApi.ExtensionContext): Promise<
|
322 | 312 | context.subscriptions.push(
|
323 | 313 | extensionApi.registry.suggestRegistry({
|
324 | 314 | name: 'Red Hat Container Registry',
|
325 |
| - icon: fileToBase64(path.resolve(__dirname, '..', 'icon.png')), |
| 315 | + icon, |
326 | 316 | url: 'registry.redhat.io',
|
327 | 317 | }),
|
328 | 318 | );
|
|
0 commit comments