mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
15030f5ce9
commit
474aaae8c6
30 files changed
+46
-54
No files matched your search
@@ -28,8 +28,7 @@ export class RolesStore extends KubeObjectStore<Role> {
|
||||
return Promise.all(
|
||||
namespaces.map(namespace => roleApi.list({ namespace }))
|
||||
).then(items => items.flat())
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return Promise.all([clusterRoleApi.list(), roleApi.list()])
|
||||
.then(items => items.flat())
|
||||
}
|
||||
@@ -38,8 +37,7 @@ export class RolesStore extends KubeObjectStore<Role> {
|
||||
protected async createItem(params: { name: string; namespace?: string }, data?: Partial<Role>) {
|
||||
if (params.namespace) {
|
||||
return roleApi.create(params, data)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return clusterRoleApi.create(params, data)
|
||||
}
|
||||
}
|
||||
@@ -47,5 +45,7 @@ export class RolesStore extends KubeObjectStore<Role> {
|
||||
|
||||
export const rolesStore = new RolesStore();
|
||||
|
||||
apiManager.registerStore(roleApi, rolesStore);
|
||||
apiManager.registerStore(clusterRoleApi, rolesStore);
|
||||
apiManager.registerStore(rolesStore, [
|
||||
roleApi,
|
||||
clusterRoleApi,
|
||||
]);
|
||||
Reference in new issue
Block a user