Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-56789

PolicyGenTemplate generates PlacementRules arrays random order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.18
    • GitOps ZTP
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      PGT Plugin creates the PlacementRoles with random order, in the arrays of `clusterSelector.matchExpressions:`:

       
      just executing the PolicyGenTemplate generator over the same file, just some seconds after and the output is different, basically because it changes the order of:
       

      > /tmp/ztp-kustomize-plugin/ran.openshift.io/v1/policygentemplate/PolicyGenTemplate common.yaml  > /tmp/file1.yaml
      > /tmp/ztp-kustomize-plugin/ran.openshift.io/v1/policygentemplate/PolicyGenTemplate common.yaml  > /tmp/file2.yaml
      > diff /tmp/file1.yaml /tmp/file2.yaml 
      76,79d75
      <             - key: configuration-version
      <               operator: In
      <               values:
      <                 - vdu-4.16-p1a8
      83a80,83
      >             - key: configuration-version
      >               operator: In
      >               values:
      >                 - vdu-4.16-p1a8 

       

       

      more in slack: https://redhat-internal.slack.com/archives/C02EG99MR9C/p1746720205725419

      This is detected by ArgoCD and Openshift as different objects and we are constantly out of sync:

      https://redhat-internal.slack.com/archives/CMP95ST2N/p1746715743405569

      Many times we dont see it, because it is solved by auto-sync. But making unnecessary syncs and requests.

       

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

          4.18, 

      How reproducible:

          invoke PGT generator several times over the same PGT, the results are different.

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          

      Expected results:

          

      Additional info:

          

              rh-ee-apalanis Abraham Miller
              jgato@redhat.com Jose Gato Luis
              None
              None
              Dwaine Gonyier Dwaine Gonyier
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: