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

[2.10] ACM PolicyGenerator How to define exceptions for placements outside of policyDefaults?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ACM 2.10.3
    • None
    • GRC
    • None
    • 1
    • False
    • None
    • False
    • No
    • GRC Sprint 2024-05, GRC Sprint 2024-06, GRC Sprint 2024-07

      Description of problem:

      Customer would like to define exceptions for placements outside of policyDefaults, but it doesn't work as documented.

      https://github.com/open-cluster-management-io/policy-generator-plugin/blob/0b07cc7f2d4b64d6ff55562a874e8d2ef4bed905/docs/policygenerator-reference.yaml#L313 describes that you can use the same fields as in the PolicyDefaults, it seems but that's not true, I get an error message from the generator in ArgoCD.

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

      How reproducible:

      Steps to Reproduce:

      1. has been already investigated
      2. ...

      Actual results:

      Here's the error:
      policy projectrequest-template must specify only one of placement selector, placement path, or placement name

      Looks like we don't allow overriding one type of Placement for another. The policyDefaults Placement object isn't being overridden by the policies Placement object--it seems it's just piling them together and generating the error.

      For example:

      apiVersion: policy.open-cluster-management.io/v1
      kind: PolicyGenerator
      policyDefaults: 
       placement: 
         clusterSelectors: 
           vendor: "OpenShift"
      policies: 
       - name: my-policy
         manifests: 
           - path: my-policy.yaml
         placement: 
           placementPath: 
             ../my-placement.yaml
      

      Expected results:

      Additional info:

            rh-ee-jaszhang Jason Zhang
            rhn-support-cstark Christian Stark
            ManiKrishna Sai Ravi
            Derek Ho Derek Ho
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: