Added check for .toLowerCase and added upgrade message for clarity. (#20187)

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-07-28 13:52:26 -07:00
committed by GitHub
parent d3073a33fe
commit 28d5382dc3
8 changed files with 76 additions and 42 deletions

View File

@@ -204,7 +204,7 @@ export class ConnectToControllerDialog extends ControllerDialogBase {
controllerModel.info.connectionMode = <string>controllerModel.controllerConfig?.spec.settings.azure.connectionMode.toLowerCase();
controllerModel.info.location = <string>controllerModel.controllerConfig?.spec.settings.azure.location;
if (controllerModel.info.connectionMode === ConnectionMode.direct) {
if (controllerModel.info.connectionMode.toLowerCase() === ConnectionMode.direct) {
const rawCustomLocation = <string>controllerModel.controllerConfig?.metadata.annotations['management.azure.com/customLocation'];
const exp = /custom[lL]ocations\/([\S]*)/;
controllerModel.info.customLocation = <string>exp.exec(rawCustomLocation)?.pop();