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

Generated placement for PolicySet results in emptly selector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • None
    • GRC
    • None
    • 2
    • False
    • None
    • False
    • ACM Sprint 24, ACM Sprint 25, ACM Sprint 26
    • Important
    • -
    • No

      Description of problem:

      When using the PolicyGenerator if a policySet is specified, but a placement is not defined the generated output creates a PlacementRule which has an empty selector – this causes the policy to deploy to all clusters.

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

      How reproducible:

      Every time

      Steps to Reproduce:

      Create a policy using a Generator like:

      Actual results:

       

      apiVersion: apps.open-cluster-management.io/v1
      kind: PlacementRule
      metadata:
        name: placement-ps-tester
        namespace: wookie-policies
      spec:
        clusterConditions:
        - status: "True"
          type: ManagedClusterConditionAvailable
        clusterSelector:
          matchExpressions: []

       

       

      Expected results:

      The generator should fail

       

      apiVersion: policy.open-cluster-management.io/v1
      kind: PolicyGenerator
      metadata:
        name: gen-policy-generator
      policyDefaults:
        namespace: wookie-policies
        remediationAction: enforce
        placement:
          placementRuleName: "hub-only"
        policySets:
          - ps-tester
      placementBindingDefaults:
        name: "ps-tester-binding"
      policies:
        - name: policyset-tester-policy
          remediationAction: enforce
          manifests:
            - path: namespace.yml

       

       

      Additional info:

              dhaiduce Dale Haiducek
              rhn-support-bjarvis Brian Jarvis
              Derek Ho Derek Ho
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: