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

ACM PolicyGenerator: specify multiple clusters in a ClusterSelectors

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Done
    • Icon: Critical Critical
    • Future
    • None
    • GRC
    • None
    • ACM PolicyGenerator: specify multiple clusters in a ClusterSelectors
    • False
    • None
    • False
    • Not Selected
    • To Do
    • ACM-1228 - ACM PolicyGenerator Improvements
    • ACM-1228ACM PolicyGenerator Improvements
    • 0% To Do, 0% In Progress, 100% Done

      This EPIC is the result of a Customer Interaction:

      Is it possible to specify multiple clusters in a ClusterSelectors field?
      According to https://github.com/stolostron/policy-generator-plugin/blob/ae7f23cf32f056670c3626d1a47962e08c6ed8b3/docs/policygenerator-reference.yaml#L116 you should be able to specify several selectors, but this works, for example, with lists ("-" in front of the key ) Not.
      Are there any working examples?

      It looks like the behavior of the generator is to create a MatchExpression for each key:value pair given:

      spec:
        predicates:
        - requiredClusterSelector:
            labelSelector:
              matchExpressions:
              - key: cloud
                operator: In
                values:
                - red hat
              - key: this-other
                operator: In
                values:
                - label
      

      If I'm not mistaken, this results in the intersection of the labels rather than the union.
      I think the workaround here is to provide a placement manifest.

            rhn-support-cstark Christian Stark
            rhn-support-cstark Christian Stark
            Derek Ho Derek Ho
            Gus Parvin Gus Parvin
            Christian Stark Christian Stark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: