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

ClusterPermission creation fails when creating multiple roleBindings within the same namespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Minor Minor
    • None
    • ACM 2.14.0
    • Cluster Lifecycle
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • Low
    • None

      Description of problem:

      ClusterPermission creation fails when creating multiple roleBindings within the same namespace

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

      How reproducible:

      apiVersion: rbac.open-cluster-management.io/v1alpha1
      kind: ClusterPermission
      metadata:
        name: clusterpermission-existing-role-sample
        namespace: feng-mc
      spec:
        roleBindings:
          - namespace: default
            roleRef:
              apiGroup: rbac.authorization.k8s.io
              kind: ClusterRole
              name: argocd-application-controller-1
            subject:
              kind: ServiceAccount
              name: sa-sample-existing
              namespace: openshift-gitops
          - namespace: default
            roleRef:
              apiGroup: rbac.authorization.k8s.io
              kind: Role
              name: argocd-application-controller-2
            subject:
              apiGroup: rbac.authorization.k8s.io
              kind: User
              name: user1 

      Steps to Reproduce:

      1. Create a ClusterPermission using the above YAML
      2. Look for the ManifestWork created by the ClusterPermission(mentioned in the status)
      3. You will see errors it can't create some of the roleBindings
      message: 'Failed to apply manifest: RoleBinding.rbac.authorization.k8s.io "clusterpermission-existing-role-sample" is invalid: roleRef: Invalid value: rbac.RoleRef{APIGroup:"rbac.authorization.k8s.io", Kind:"Role", Name:"argocd-application-controller-2"}: cannot change roleRef' 

      This is due to the roleBinding with the same name already created so when second roleBinding is creating it fails.

      Actual results:

      Expected results:

      Additional info:

              fxiang@redhat.com Feng Xiang
              fxiang@redhat.com Feng Xiang
              David Huynh David Huynh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: