Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18337 from juanvallejo/jvallejo/restore-obj-onfai…
…lure-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
- Loading branch information