Skip to content

Commit

Permalink
Stop trying to connect to a cluster when it doesn't appear to be avai…
Browse files Browse the repository at this point in the history
…lable

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
  • Loading branch information
vrubezhny authored and datho7561 committed Jan 30, 2024
1 parent 3e7a8fe commit 4928429
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/openshift/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ export class Cluster extends OpenShiftItem {
);
if (promptResponse === startCrc){
await commands.executeCommand('openshift.explorer.addCluster', 'crc');
// no point in continuing with the wizard,
// it will take the cluster a few minutes to stabilize
return null;
}
// Anyway, no point in continuing with the wizard
return null;
} else if (Cluster.isSandboxCluster(clusterURL)) {
const devSandboxSignup = 'Sign up for OpenShift Dev Sandbox';
const promptResponse = await window.showWarningMessage(
Expand All @@ -543,15 +543,17 @@ export class Cluster extends OpenShiftItem {
);
if (promptResponse === devSandboxSignup){
await commands.executeCommand('openshift.explorer.addCluster', 'sandbox');
// no point in continuing with the wizard,
// the user needs to sign up for the service
return null;
}
} else {
void window.showWarningMessage(
'Unable to contact the cluster. Is it running and accessible?',
);
// Anyway, no point in continuing with the wizard
return null;
}

// Stop trying because the cluster doesn't appear to be available
void window.showWarningMessage(
'Unable to contact the cluster. Is it running and accessible?',
);
return null;
}
} while (!clusterIsUp);

Expand Down

0 comments on commit 4928429

Please sign in to comment.