1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Show system roles when creating new role binding

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-05-08 22:24:53 +03:00
parent 3f4aad911a
commit a8a5451ae3
2 changed files with 2 additions and 17 deletions

View File

@ -9,7 +9,7 @@ import { Dialog, DialogProps } from "../dialog";
import { Wizard, WizardStep } from "../wizard";
import { Select, SelectOption } from "../select";
import { SubTitle } from "../layout/sub-title";
import { IRoleBindingSubject, RoleBinding, ServiceAccount } from "../../api/endpoints";
import { IRoleBindingSubject, RoleBinding, ServiceAccount, Role } from "../../api/endpoints";
import { Icon } from "../icon";
import { Input } from "../input";
import { NamespaceSelect } from "../+namespaces/namespace-select";
@ -152,7 +152,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
};
@computed get roleOptions(): BindingSelectOption[] {
let roles = rolesStore.items.filter(KubeObject.isNonSystem);
let roles = rolesStore.items as Role[]
if (this.bindContext) {
// show only cluster-roles or roles for selected context namespace
roles = roles.filter(role => !role.getNs() || role.getNs() === this.bindContext);

View File

@ -10,8 +10,6 @@ import { rolesStore } from "./roles.store";
import { clusterRoleApi, Role, roleApi } from "../../api/endpoints";
import { KubeObjectListLayout } from "../kube-object";
import { AddRoleDialog } from "./add-role-dialog";
import { Icon } from "../icon";
import { KubeObject } from "../../api/kube-object";
import { apiManager } from "../../api/api-manager";
enum sortBy {
@ -40,19 +38,6 @@ export class Roles extends React.Component<Props> {
(role: Role) => role.getSearchFields(),
]}
renderHeaderTitle={<Trans>Roles</Trans>}
customizeHeader={({ info }) => ({
info: (
<>
{info}
<Icon
small
material="help_outline"
className="help-icon"
tooltip={<Trans>Excluded items with "system:" prefix</Trans>}
/>
</>
)
})}
renderTableHeader={[
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },