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

oc apply is sensitive to array ordering on auto-sorted fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • 4.12.0, 4.16.0
    • apiserver-auth
    • None
    • Low
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      
      We want to use `oc apply` with a SCC whose `volumes` field is not alphabetically sorted. While applying the SCC, the `volumes` field gets auto-sorted (and appears as such in the SCC and last-applied-configuration annotation).
      
      As a result, when we run `oc apply` again with the same file, it notices that the `volumes` arrays are different (the one from the file is not sorted, the one in the cluster is sorted) and re-applies the file as if it was modified, i.e. it behaves as if it performed a modification on the file but doesn't.
         
      This will be better explained with a example in comments.
      

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

      This has been reproduced in 4.12.36 and 4.16.2
      

      How reproducible:

      Always
      

      Steps to Reproduce:

          1. Use oc apply to create a SCC that has a volumes field that is NOT sorted alphabetically
          2. Run oc apply to the same file after creation many times
          3.
      

      Actual results:

      oc apply behaves as if it made a change, outputting that the resource has been "configured" and increasing the resourceVersion
      

      Expected results:

      oc apply to properly detect that no change is required. Output that the resource is "unchanged". No increase in resourceVersion.
      

      Additional info:

      In internal comments (both examples and impact).
      

              Unassigned Unassigned
              rhn-support-palonsor Pablo Alonso Rodriguez
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: