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 committed Jan 30, 2024
1 parent b361edc commit be59cc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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;

Check warning on line 536 in src/openshift/cluster.ts

View check run for this annotation

Codecov / codecov/patch

src/openshift/cluster.ts#L536

Added line #L536 was not covered by tests
} else if (Cluster.isSandboxCluster(clusterURL)) {
const devSandboxSignup = 'Sign up for OpenShift Dev Sandbox';
const promptResponse = await window.showWarningMessage(
Expand All @@ -548,9 +548,11 @@ export class Cluster extends OpenShiftItem {
return null;
}
} else {
// 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;

Check warning on line 555 in src/openshift/cluster.ts

View check run for this annotation

Codecov / codecov/patch

src/openshift/cluster.ts#L555

Added line #L555 was not covered by tests
}
}
} while (!clusterIsUp);
Expand Down

0 comments on commit be59cc3

Please sign in to comment.