Skip to content

Commit 75f08f0

Browse files
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
2 parents 057e3b3 + 1816810 commit 75f08f0

File tree

1 file changed

+13
-3
lines changed
  • vendor/k8s.io/kubernetes/pkg/kubectl/cmd

1 file changed

+13
-3
lines changed

vendor/k8s.io/kubernetes/pkg/kubectl/cmd/apply.go

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)