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

Fixes migration controller null pointer dereference #5694

Merged
merged 2 commits into from May 24, 2021

Conversation

davidvossel
Copy link
Member

If a migration object transistions to "Failed" before being handed off to virt-controller, it's possible that we'll attempt to access the vmi.Status.MigrationState when it's an uninitialized null pointer. This can happen for example if the target pod fails during execution before the handoff, or if the target pod is somehow deleted before the handoff.

The result is that virt-controller can get into a situation where it crash loops until the effected migration object is removed from the cluster.

Fixes null pointer dereference in migration controller

Signed-off-by: David Vossel <davidvossel@gmail.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/S labels May 21, 2021
@acardace
Copy link
Member

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2021
Copy link
Contributor

@enp0s3 enp0s3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidvossel Great catch!
There is some issue with the migration unit tests(I've reproduced the fails locally using this PR as a rebase). Trying to find out the root cause. Can you please take a look?

@enp0s3
Copy link
Contributor

enp0s3 commented May 24, 2021

@davidvossel Great catch!
There is some issue with the migration unit tests(I've reproduced the fails locally using this PR as a rebase). Trying to find out the root cause. Can you please take a look?

@davidvossel OK I think that we probably should not expect the VMI to be patched while VMI.status.MigrationState is nil, in the unit tests.

Copy link
Member

@stu-gott stu-gott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stu-gott

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2021
@davidvossel
Copy link
Member Author

/hold

looking into unit tests

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2021
Signed-off-by: David Vossel <davidvossel@gmail.com>
@kubevirt-bot kubevirt-bot added size/M and removed lgtm Indicates that a PR is ready to be merged. size/S labels May 24, 2021
@davidvossel
Copy link
Member Author

/hold cancel

Thanks @enp0s3, the unit test were indeed failing. Odd that CI didn't catch this though. I've fixed the tests and improved how we validate the patch contents in the tests as well.

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2021
@davidvossel
Copy link
Member Author

/cherry-pick release-0.41

@kubevirt-bot
Copy link
Contributor

@davidvossel: once the present PR merges, I will cherry-pick it on top of release-0.41 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.41

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@davidvossel
Copy link
Member Author

/cherry-pick release-0.36

@kubevirt-bot
Copy link
Contributor

@davidvossel: once the present PR merges, I will cherry-pick it on top of release-0.36 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.36

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@davidvossel
Copy link
Member Author

/cherry-pick release-0.34

@kubevirt-bot
Copy link
Contributor

@davidvossel: once the present PR merges, I will cherry-pick it on top of release-0.34 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.34

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@stu-gott stu-gott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2021
@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented May 24, 2021

@davidvossel: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubevirt-goveralls 5167f64 link /test pull-kubevirt-goveralls

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kubevirt-bot kubevirt-bot merged commit 3abefaa into kubevirt:master May 24, 2021
@kubevirt-bot
Copy link
Contributor

@davidvossel: new pull request created: #5707

In response to this:

/cherry-pick release-0.41

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot
Copy link
Contributor

@davidvossel: new pull request created: #5708

In response to this:

/cherry-pick release-0.36

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubevirt-bot
Copy link
Contributor

@davidvossel: new pull request created: #5709

In response to this:

/cherry-pick release-0.34

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@maya-r
Copy link
Contributor

maya-r commented May 25, 2021

This PR seems to cause goveralls to fail

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants