Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-24911

MulticlusterRoleAssignment - Logs error on ClusterPermission conflict retry when it should be INFO

XMLWordPrintable

    • VMMgmt - Train-33 - Sprint 1
    • Moderate
    • None

      Description of problem:

      We are logging ERROR here, which causes a stack trace to get printed also:

       

      2025-10-02T23:08:26Z    ERROR   Failed to update ClusterPermission      {"controller": "multiclusterroleassignment", "controllerGroup": "rbac.open-cluster-management.io", "controllerKind": "MulticlusterRoleAssignment", "MulticlusterRoleAssignment": {"name":"role-assignment-1759446505846-imgitw6aw","namespace":"open-cluster-management-global-set"}, "namespace": "open-cluster-management-global-set", "name": "role-assignment-1759446505846-imgitw6aw", "reconcileID": "9843daed-3158-4125-bcde-d6f501f5f631", "error": "Operation cannot be fulfilled on clusterpermissions.rbac.open-cluster-management.io \"mra-managed-permissions\": the object has been modified; please apply your changes to the latest version and try again"}
      github.com/stolostron/multicluster-role-assignment/internal/controller.(*MulticlusterRoleAssignmentReconciler).ensureClusterPermissionAttempt
              /workspace/internal/controller/multiclusterroleassignment_controller.go:803
      github.com/stolostron/multicluster-role-assignment/internal/controller.(*MulticlusterRoleAssignmentReconciler).ensureClusterPermission
              /workspace/internal/controller/multiclusterroleassignment_controller.go:718
      github.com/stolostron/multicluster-role-assignment/internal/controller.(*MulticlusterRoleAssignmentReconciler).processClusterPermissions
              /workspace/internal/controller/multiclusterroleassignment_controller.go:630
      github.com/stolostron/multicluster-role-assignment/internal/controller.(*MulticlusterRoleAssignmentReconciler).Reconcile
              /workspace/internal/controller/multiclusterroleassignment_controller.go:286
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile
              /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:119
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
              /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:340
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
              /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:300
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.1
              /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:202
      2025-10-02T23:08:26Z    INFO    ClusterPermission update conflict, retrying     {"controller": "multiclusterroleassignment", "controllerGroup": "rbac.open-cluster-management.io", "controllerKind": "MulticlusterRoleAssignment", "MulticlusterRoleAssignment": {"name":"role-assignment-1759446505846-imgitw6aw","namespace":"open-cluster-management-global-set"}, "namespace": "open-cluster-management-global-set", "name": "role-assignment-1759446505846-imgitw6aw", "reconcileID": "9843daed-3158-4125-bcde-d6f501f5f631", "cluster": "sno-2-hk9nw", "error": "Operation cannot be fulfilled on clusterpermissions.rbac.open-cluster-management.io \"mra-managed-permissions\": the object has been modified; please apply your changes to the latest version and try again"}

      We should log into on retries and only log ERROR of all retries failed, or if any errors are not due to conflicts.

       

      Version-Release number of selected component (if applicable):

      How reproducible:

      Every time.

      Steps to Reproduce:

      1. Create multiple role assignments simultaneously from rbac UI that target the same existing ClusterPermissions
      2. View multiclusterroleassignment controller log, you should see ERROR

      Actual results:

      ERROR is logged and stack trace is printed.

      Expected results:

      Should only log ERROR if all conflict retries fail, or if error is not a conflict error.

      Additional info:

              rh-ee-mshort Matthew Short
              rh-ee-mshort Matthew Short
              Atif Shafi Atif Shafi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: