You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #18337 from juanvallejo/jvallejo/restore-obj-onfailure-apply
Automatic merge from submit-queue.
UPSTREAM: 58991: restore original object on apply err
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1539529
When `oc apply` is used with the `--force` flag, it will attempt to patch an existing object `A` up to 5 times before it deletes the existing object and re-creates it with a new object `B` originally used to patch `A`.
If object `B` has invalid syntax, or a change preventing it from passing validation, the new object will fail to be created and `oc apply` will simply delete the original object without informing the user that their object no longer exists, and a new one was not created.
This patch restores the original object in the event that an error occurs while attempting to outright replace it with a new one.
Hoping to use this thread to at least discuss the nature of `oc apply --force`, and better define its behavior when it encounters a non-conflict error.
cc @ironcladlou
0 commit comments