• Jordan Liggitt's avatar
    collapse patch conflict retry onto GuaranteedUpdate · fbd6f380
    Jordan Liggitt authored
    builds on #62868
    
    1. When the incoming patch specified a resourceVersion that failed as a precondition,
    the patch handler would retry uselessly 5 times. This PR collapses onto GuaranteedUpdate,
    which immediately stops retrying in that case.
    
    2. When the incoming patch did not specify a resourceVersion, and persisting to etcd
    contended with other etcd updates, the retry would try to detect patch conflicts with
    deltas from the first 'current object' retrieved from etcd and fail with a conflict error
    in that case. Given that the user did not provide any information about the starting version
    they expected their patch to apply to, this does not make sense, and results in arbitrary
    conflict errors, depending on when the patch was submitted relative to other changes made
    to the resource. This PR changes the patch application to be performed on the object retrieved
    from etcd identically on every attempt.
    
    fixes #58017
    SMP is no longer computed for CRD objects
    
    fixes #42644
    No special state is retained on the first attempt, so the patch handler correctly handles
    the cached storage optimistically trying with a cached object first
    fbd6f380