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

[library-go] `ApplyStorageClass()` must not ignore `ResourceVersion` of `required` StorageClass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 4.14
    • Storage / Operators
    • None
    • Important
    • No
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      A caller of ApplyStorageClass(), for example syncStorageClass() from pkg/operator/csi/csistorageclasscontroller/csi_storageclass_controller.go, may want to make decision about new state of StorageClass based on a state of objects it received by:

      	existingSCs, err := storageClassLister.List(labels.Everything())
      

      In this case, to avoid races (like one explained in https://issues.redhat.com/browse/OCPBUGS-14824), it's crucial to pass ResourceVersion from the caller to ApplyStorageClass().

      If "required" arg of ApplyStorageClass() has ResourceVersion set, then it must fail update operation if newly read StorageClass has newer version.

            rh-ee-mpatlaso Maxim Patlasov
            rhn-support-pewang Penghao Wang
            Penghao Wang Penghao Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: