diff --git a/src/api/index.js b/src/api/index.js index 3275c8303..ca7add847 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -107,6 +107,10 @@ export async function getInstallProperties() { data = await get(uri); } catch (error) { if (error?.response?.status === 404) { + // eslint-disable-next-line no-console + console.warn( + 'Install properties not found, setting client-mode defaults' + ); data = { dashboardNamespace: 'N/A', dashboardVersion: 'kubectl-proxy-client', @@ -116,6 +120,13 @@ export async function getInstallProperties() { triggersNamespace: 'Unknown', triggersVersion: 'Unknown' }; + } else { + // eslint-disable-next-line no-console + console.error( + 'Failed loading install properties, setting read-only default', + error + ); + data = { isReadOnly: true }; } } return data; diff --git a/src/api/index.test.js b/src/api/index.test.js index ec6a87926..71bad725b 100644 --- a/src/api/index.test.js +++ b/src/api/index.test.js @@ -483,7 +483,7 @@ describe('getInstallProperties', () => { http.get(/\/properties$/, () => new HttpResponse(null, { status: 500 })) ); const properties = await API.getInstallProperties(); - expect(properties).toBeUndefined(); + expect(properties).toEqual({ isReadOnly: true }); }); });