Skip to content
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

Fix FieldManager Conversion Error for CRD Updates #91873

Merged
merged 1 commit into from Jun 19, 2020

Conversation

kwiesmueller
Copy link
Member

@kwiesmueller kwiesmueller commented Jun 7, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:

When handling a crd update, the fieldManager sometimes fails conversion of the live object an error like:
failed to update object (Update for openfaas.com/v1, Kind=Function) managed fields: failed to convert live object to proper version: /, Kind= is unstructured and is not suitable for converting to "openfaas.com/v1"

This seems to be caused by the fieldManager receiving a liveObject that is empty.

The current approach changes the Update call to not call the UpdateHandler if there is no existing object and createOnUpdate is not allowed.
This way the fieldManager never gets called.

Which issue(s) this PR fixes:

Partial fix for #90904

NONE

/sig api-machinery
/wg api-expression
/cc @apelisse @liggitt

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 7, 2020
@kwiesmueller
Copy link
Member Author

/retest

@kwiesmueller
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2020
@liggitt
Copy link
Member

liggitt commented Jun 9, 2020

one nit on the test to output helpful things if we don't get the error we expected

Reverting the non-test portions of #91690 (which I think was the plan for 1.19?) lets this test exercise the failure condition and produces an unknown error without the accompanying store change. Are we ready to do that?

@kwiesmueller
Copy link
Member Author

When reverting #91690 the test here still won't fail.
Right now, the 404 would also be returned without the change in this PR as #91690 makes the update ignore the error, so storage can proceed until the notFound gets returned.
So the test here is not testing the change directly, but the situation we want which currently both changes achieve separately.
At least that was the result of me reverting #91690 yesterday. Does that make sense?

@kwiesmueller kwiesmueller force-pushed the fix-crd-update-bug branch 2 times, most recently from 0e6c913 to 0327bd4 Compare June 9, 2020 11:30
@kwiesmueller kwiesmueller changed the title [WIP] Fix FieldManager Conversion Error for CRD Updates Fix FieldManager Conversion Error for CRD Updates Jun 9, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 9, 2020
@fedebongio
Copy link
Contributor

/assign @liggitt @apelisse

@liggitt
Copy link
Member

liggitt commented Jun 10, 2020

wait.go:211: unexpected response, will retry: nodes "node2" not found
node_test.go:483: Expected forbidden error, got nodes "node2" not found

This line is trying to update a node that doesn't exist with a different node's client, which would have been rejected by admission previously and now receives a NotFound error. This is expected because of the order change, but represents a behavior change I probably wouldn't expect us to backport.

To fix this test, you could change line 483 to:

expectNotFound(t, updateNode2Status(node1Client))

and add this after the // self deletion is not allowed test:

// self deletion is not allowed
expectForbidden(t, deleteNode2(node2Client))
// modification of another node's status is not allowed
expectForbidden(t, updateNode2Status(node1Client))

@kwiesmueller
Copy link
Member Author

Thanks Jordan!
I fixed the test. Didn't expect us to backport this change anyways and as we already backported the ignore PR i don't think it's necessary as the bug is bypassed by it.

@kwiesmueller
Copy link
Member Author

/retest

@liggitt
Copy link
Member

liggitt commented Jun 11, 2020

thanks, please squash, then lgtm

@liggitt
Copy link
Member

liggitt commented Jun 11, 2020

/approve
/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 11, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kwiesmueller, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2020
@apelisse
Copy link
Member

Thanks,
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 17, 2020

/hold Temporary hold to get prow/tide to get back on its feet. Feel free to remove hold in a few hours.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 17, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 18, 2020

/hold Temporary hold to get prow/tide to get back on its feet. Feel free to remove hold in a few hours.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@dims
Copy link
Member

dims commented Jun 18, 2020

/test all

@dims
Copy link
Member

dims commented Jun 18, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@kwiesmueller
Copy link
Member Author

/retest

2 similar comments
@dims
Copy link
Member

dims commented Jun 18, 2020

/retest

@kwiesmueller
Copy link
Member Author

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 7a68eac into kubernetes:master Jun 19, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants