mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Do not filter contexts when adding new clusters (#969)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
51b21347da
commit
d0f1d7b74b
@ -129,10 +129,6 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
return this.clusters.size > 0;
|
||||
}
|
||||
|
||||
hasContextInWorkspace(name: string, workspaceId: string) {
|
||||
return this.clustersList.some(cluster => cluster.contextName === name && cluster.workspace === workspaceId);
|
||||
}
|
||||
|
||||
getById(id: ClusterId): Cluster {
|
||||
return this.clusters.get(id);
|
||||
}
|
||||
|
||||
@ -198,13 +198,6 @@ describe("config with existing clusters", () => {
|
||||
expect(storedClusters[1].preferences.terminalCWD).toBe('/foo2')
|
||||
expect(storedClusters[2].id).toBe('cluster3')
|
||||
})
|
||||
|
||||
it("allows to test if store already has context in workspace", async () => {
|
||||
const existingContext = clusterStore.hasContextInWorkspace('foo', 'default');
|
||||
expect(existingContext).toBeTruthy
|
||||
const nonExistingContext = clusterStore.hasContextInWorkspace('foo2', 'foo');
|
||||
expect(existingContext).toBeFalsy
|
||||
})
|
||||
})
|
||||
|
||||
describe("pre 2.0 config with an existing cluster", () => {
|
||||
|
||||
@ -99,10 +99,7 @@ export class AddCluster extends React.Component {
|
||||
getContexts(config: KubeConfig): Map<string, KubeConfig> {
|
||||
const contexts = new Map();
|
||||
splitConfig(config).forEach(config => {
|
||||
const isExists = clusterStore.hasContextInWorkspace(config.currentContext, workspaceStore.currentWorkspaceId);
|
||||
if (!isExists) {
|
||||
contexts.set(config.currentContext, config);
|
||||
}
|
||||
})
|
||||
return contexts
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user