-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPSTREAM: 58991: restore original object on apply err #18337
UPSTREAM: 58991: restore original object on apply err #18337
Conversation
I want to create an upstream issue to discuss. We shouldn't delete the resource only to recreate it if we can establish in advance the resource is invalid and has no hope of being persisted. This also brings in to question the semantics of |
kubectl actually seems to handle this correctly, so we need to investigate why there's a behavioral disparity in oc. |
I was able to break kubectl with a server-side-validated replicationcontroller in the same way reported for deploymentconfigs, so we do still have an upstream issue to discuss. |
The |
1eac65f
to
117f9f4
Compare
Explanation of what is happening in the bugzilla (two different edge-cases are being hit): https://bugzilla.redhat.com/show_bug.cgi?id=1539529#c3 |
Upstream PR: kubernetes/kubernetes#58991 |
117f9f4
to
10d0aff
Compare
/hold @juanvallejo just to help sort out what's being picked and not yet lgtm'd/merged upstream, can you apply holds on the picks? |
10d0aff
to
be74c71
Compare
be74c71
to
1816810
Compare
@deads2k @ironcladlou Upstream PR merged kubernetes/kubernetes#58991 This one is now up to date |
/retest |
1 similar comment
/retest |
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, juanvallejo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
/test cmd |
/test extended_conformance_install |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
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 objectA
up to 5 times before it deletes the existing object and re-creates it with a new objectB
originally used to patchA
.If object
B
has invalid syntax, or a change preventing it from passing validation, the new object will fail to be created andoc 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