mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
feature should work of any method of adding kube config
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
88eed88feb
commit
35ab6ffe4a
@ -80,20 +80,20 @@ export class AddCluster extends React.Component {
|
|||||||
const contexts = this.getContexts(this.kubeConfigLocal);
|
const contexts = this.getContexts(this.kubeConfigLocal);
|
||||||
this.kubeContexts.replace(contexts);
|
this.kubeContexts.replace(contexts);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KubeConfigSourceTab.TEXT:
|
case KubeConfigSourceTab.TEXT:
|
||||||
try {
|
try {
|
||||||
this.error = ""
|
this.error = ""
|
||||||
const contexts = this.getContexts(loadConfig(this.customConfig || "{}"));
|
const contexts = this.getContexts(loadConfig(this.customConfig || "{}"));
|
||||||
this.kubeContexts.replace(contexts);
|
this.kubeContexts.replace(contexts);
|
||||||
if (this.kubeContexts.size === 1) {
|
|
||||||
this.selectedContexts.push(this.kubeContexts.keys().next().value)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.error = String(err);
|
this.error = String(err);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.kubeContexts.size === 1) {
|
||||||
|
this.selectedContexts.push(this.kubeContexts.keys().next().value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getContexts(config: KubeConfig): Map<string, KubeConfig> {
|
getContexts(config: KubeConfig): Map<string, KubeConfig> {
|
||||||
@ -383,7 +383,7 @@ export class AddCluster extends React.Component {
|
|||||||
label={<Trans>Add cluster(s)</Trans>}
|
label={<Trans>Add cluster(s)</Trans>}
|
||||||
onClick={this.addClusters}
|
onClick={this.addClusters}
|
||||||
waiting={this.isWaiting}
|
waiting={this.isWaiting}
|
||||||
tooltip={addDisabled ? "Select at least one cluster to add." : undefined}
|
tooltip={addDisabled ? _i18n._("Select at least one cluster to add.") : undefined}
|
||||||
tooltipOverrideDisabled
|
tooltipOverrideDisabled
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user