Skip to content

Commit

Permalink
Merge pull request #251 from weaveworks/fix-218
Browse files Browse the repository at this point in the history
Fixup #248
  • Loading branch information
Kingdon Barrett authored Apr 27, 2022
2 parents e29e63a + ff1c84b commit 1f162e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/kubernetes/kubernetesTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ class KubernetesTools {
};
}

async getClusterName(contextName: string): Promise<undefined | string> {
async getClusterName(contextName: string): Promise<string> {
const contexts = await this.getContexts();
if(contexts.succeeded === true) {
return contexts.result.find(context => context.name === contextName)?.context.clusterInfo?.name;
return contexts.result.find(context => context.name === contextName)?.context.clusterInfo?.name || contextName;
} else {
return contextName;
}
}

Expand Down

0 comments on commit 1f162e0

Please sign in to comment.