Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-2390

ApplicationSets using shared clusterDecisionResource causes all AppSets from generating if any placement fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 1.5.4, 1.6.1
    • ArgoCD
    • 8
    • False
    • None
    • False
    • GITOPS Sprint 3244

      +underlined text+When having ApplicationSet that uses shared clsuterDecisionResource, if a cluster is not found to apply one of them, it will not apply any of the application.

      The applicationSet has these.

       

       

        generators:
        - clusterDecisionResource:
            configMapRef: acm-placement
            labelSelector:
              matchLabels:
                cluster.open-cluster-management.io/placement: cluster-common-dev
            requeueAfterSeconds: 180
            values:
              targetRef: feature-vishaltest
        - clusterDecisionResource:
            configMapRef: acm-placement
            labelSelector:
              matchLabels:
                cluster.open-cluster-management.io/placement: cluster-infra-dev
            requeueAfterSeconds: 180
            values:
              targetRef: develop

       

       

      What this means is that look for the resource kind defined in configMapRef: acm-placement that has label cluster.open-cluster-management.io/placement: cluster-infra-dev. The resource is PlacementDecision.

      When you remove the label cluster-infra=dev from the clustername cluster, the cluster-infra-dev placement cannot make any decision because there is no cluster matching the placement criteria so it removes the PlacementDecision. You can check using oc get placementdecision -n openshift-gitops --show-labels

      Since the application set has a reference to a clusterDecisionResource 

       

      clusterDecisionResource:
            configMapRef: acm-placement
            labelSelector:
              matchLabels:
                cluster.open-cluster-management.io/placement: cluster-infra-dev

       

      which does not exist any more, the application set controller throws this error and cannot re-generate applicaitons.

       

      time="2022-10-26T17:25:24Z" level=info msg="Kind.Group/Version Reference" kind.apiVersion=placementdecisions.cluster.open-cluster-management.io/v1beta1
      time="2022-10-26T17:25:24Z" level=info msg="selection type" listOptions.LabelSelector="cluster.open-cluster-management.io/placement=cluster-infra-dev"
      time="2022-10-26T17:25:24Z" level=warning msg="no resource found, make sure you clusterDecisionResource is defined correctly"
      time="2022-10-26T17:25:24Z" level=error msg="error generating params" error="no clusterDecisionResources found" generator="&{0xc00005c058 0xc000812280 0xc0012d5e00 openshift-gitops 0xc00089e240}"
      time="2022-10-26T17:25:24Z" level=error msg="error generating application from params" error="no clusterDecisionResources found" generator="{<nil> <nil> <nil> <nil> 0xc000a7e600 <nil> <nil> <nil>}"
       
      

      In addition, if you change log level to debug you'll see that the generator actually generates the application for one cluster which is in the existing placement decision, but just does not apply it because of the error on the missing placement decision

              Unassigned Unassigned
              rhn-support-ngirard Neil Girard
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: