@@ -329,8 +329,9 @@ func (r *NamespaceScopeReconciler) DeleteRbacFromUnmanagedNamespace(ctx context.
329329 return err
330330 }
331331 unmanagedNss := util .GetListDifference (nsInCm , nsInCr )
332+ configmapValue := util .GetFirstNCharacter (instance .Spec .ConfigmapName + "-" + instance .Namespace , 63 )
332333 labels := map [string ]string {
333- "namespace-scope-configmap" : instance . Namespace + "-" + instance . Spec . ConfigmapName ,
334+ "namespace-scope-configmap" : configmapValue ,
334335 }
335336
336337 operatorNs , err := util .GetOperatorNamespace ()
@@ -364,8 +365,9 @@ func (r *NamespaceScopeReconciler) DeleteRbacFromUnmanagedNamespace(ctx context.
364365
365366// When delete NamespaceScope instance, cleanup all RBAC resources
366367func (r * NamespaceScopeReconciler ) DeleteAllRbac (ctx context.Context , instance * operatorv1.NamespaceScope ) error {
368+ configmapValue := util .GetFirstNCharacter (instance .Spec .ConfigmapName + "-" + instance .Namespace , 63 )
367369 labels := map [string ]string {
368- "namespace-scope-configmap" : instance . Namespace + "-" + instance . Spec . ConfigmapName ,
370+ "namespace-scope-configmap" : configmapValue ,
369371 }
370372
371373 operatorNs , err := util .GetOperatorNamespace ()
@@ -461,8 +463,9 @@ func (r *NamespaceScopeReconciler) updateRuntimeRoleForNSS(ctx context.Context,
461463}
462464
463465func (r * NamespaceScopeReconciler ) generateRBACToNamespace (ctx context.Context , instance * operatorv1.NamespaceScope , saNames []string , fromNs , toNs string ) error {
466+ configmapValue := util .GetFirstNCharacter (instance .Spec .ConfigmapName + "-" + instance .Namespace , 63 )
464467 labels := map [string ]string {
465- "namespace-scope-configmap" : instance . Namespace + "-" + instance . Spec . ConfigmapName ,
468+ "namespace-scope-configmap" : configmapValue ,
466469 "app.kubernetes.io/instance" : "namespace-scope" ,
467470 "app.kubernetes.io/managed-by" : "ibm-namespace-scope-operator" ,
468471 "app.kubernetes.io/name" : instance .Spec .ConfigmapName ,
0 commit comments