From 45cab91fac150aa74b8b35d194e245907a2f65e3 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 5 Aug 2024 09:46:10 +0200 Subject: [PATCH] Server airgap samples Signed-off-by: Anatolii Bazko --- .../src/services/bootstrap/index.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/dashboard-frontend/src/services/bootstrap/index.ts b/packages/dashboard-frontend/src/services/bootstrap/index.ts index 81eeb995d..b7e7a99a2 100644 --- a/packages/dashboard-frontend/src/services/bootstrap/index.ts +++ b/packages/dashboard-frontend/src/services/bootstrap/index.ts @@ -331,22 +331,24 @@ export default class Bootstrap { undefined, ); - const airGapedSampleURL = new URL('/dashboard/api/airgap-sample', window.location.origin).href; - await requestRegistriesMetadata(airGapedSampleURL, false)( - this.store.dispatch, - this.store.getState, - undefined, - ); - const serverConfig = this.store.getState().dwServerConfig.config; const devfileRegistry = serverConfig.devfileRegistry; const internalDevfileRegistryUrl = serverConfig.devfileRegistryURL; if ( devfileRegistry?.disableInternalRegistry !== undefined && - devfileRegistry?.disableInternalRegistry !== true && - internalDevfileRegistryUrl + devfileRegistry?.disableInternalRegistry !== true ) { - await requestRegistriesMetadata(internalDevfileRegistryUrl, false)( + if (internalDevfileRegistryUrl) { + await requestRegistriesMetadata(internalDevfileRegistryUrl, false)( + this.store.dispatch, + this.store.getState, + undefined, + ); + } + + const airGapedSampleURL = new URL('/dashboard/api/airgap-sample', window.location.origin) + .href; + await requestRegistriesMetadata(airGapedSampleURL, false)( this.store.dispatch, this.store.getState, undefined,