Merge pull request #3281 from codyrancher/cluster-member-is-system

Updating how we check to see if a clusterroletemplatebinding isSystem
This commit is contained in:
codyrancher 2021-06-18 08:52:12 -07:00 committed by GitHub
commit 0ddba568da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,8 @@ export const CONTAINER_DEFAULT_RESOURCE_LIMIT = 'field.cattle.io/containerDefaul
export const CATTLE_PUBLIC_ENDPOINTS = 'field.cattle.io/publicEndpoints';
export const TARGET_WORKLOADS = 'field.cattle.io/targetWorkloadIds';
export const UI_MANAGED = 'management.cattle.io/ui-managed';
export const CREATOR_ID = 'field.cattle.io/creatorId';
export const CREATOR_OWNER_BINDING = 'authz.management.cattle.io/creator-owner-binding';
export const KUBERNETES = {
SERVICE_ACCOUNT_UID: 'kubernetes.io/service-account.uid',

View File

@ -1,3 +1,4 @@
import { CREATOR_ID, CREATOR_OWNER_BINDING } from '@/config/labels-annotations';
import { _CREATE } from '@/config/query-params';
import { MANAGEMENT } from '@/config/types';
@ -79,5 +80,9 @@ export default {
subSearch() {
return [{ nameDisplay: this.nameDisplay }];
},
isSystem() {
return !this.metadata.annotations[CREATOR_ID] && this.metadata.annotations[CREATOR_OWNER_BINDING] !== 'true';
}
};

View File

@ -49,7 +49,7 @@ export default {
computed: {
filteredClusterRoleTemplateBindings() {
return this.clusterRoleTemplateBindings
.filter(b => !b.user?.isSystem && b.clusterName === this.$store.getters['currentCluster'].id);
.filter(b => !b.isSystem && b.clusterName === this.$store.getters['currentCluster'].id);
}
},