Skip to content

Commit 84d7cfe

Browse files
authored
change the order or configmap name and namespace name (#347)
Signed-off-by: Allen Li <[email protected]>
1 parent 0f1d171 commit 84d7cfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/namespacescope_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ func (r *NamespaceScopeReconciler) GetRolesFromNamespace(ctx context.Context, in
552552

553553
roles := []rbacv1.Role{}
554554
for _, role := range rolesList.Items {
555-
if value, ok := role.Labels[constant.NamespaceScopeConfigmapLabelKey]; ok && value == instance.Namespace+"-"+instance.Spec.ConfigmapName {
555+
configmapValue := util.GetFirstNCharacter(instance.Spec.ConfigmapName+"-"+instance.Namespace, 63)
556+
if value, ok := role.Labels[constant.NamespaceScopeConfigmapLabelKey]; ok && value == configmapValue {
556557
roles = append(roles, role)
557558
}
558559
}

0 commit comments

Comments
 (0)