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

Filter out LiveMigrate workloadUpdateMethod on SNO #1823

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

tiraboschi
Copy link
Member

Explicitly filter out LiveMigrate
workloadUpdateMethod on SNO clusters.
On SNO cluster Live Migration FG is globally
disabled because we have a single worker node
but still we allow the user (and it's
the default) to pass
workloadUpdateMethod=["LiveMigrate"]
and this causes an infinite loop in
the upgrade handler in virt-controller
that currently ignores the LiveMigration FG.
Let's explicitly filter out LiveMigrate
workloadUpdateMethod to prevent the issue.

Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=2065308

Signed-off-by: Simone Tiraboschi stirabos@redhat.com

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Release note:

Filter out LiveMigrate workloadUpdateMethod on SNO

@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. labels Mar 17, 2022
@tiraboschi
Copy link
Member Author

/cherry-pick release-1.6

@kubevirt-bot
Copy link
Contributor

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

In response to this:

/cherry-pick release-1.6

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.

@coveralls
Copy link
Collaborator

coveralls commented Mar 17, 2022

Pull Request Test Coverage Report for Build 2014768203

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 84.532%

Totals Coverage Status
Change from base Build 1991213068: 0.05%
Covered Lines: 3749
Relevant Lines: 4435

💛 - Coveralls

@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 18, 2022

hco-e2e-image-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-azure

In response to this:

hco-e2e-image-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-azure

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 18, 2022

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-azure
hco-e2e-upgrade-prev-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws, ci/prow/hco-e2e-upgrade-prev-index-azure, ci/prow/hco-e2e-upgrade-prev-index-sno-azure

In response to this:

hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws
hco-e2e-upgrade-prev-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-azure
hco-e2e-upgrade-prev-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-azure

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.

@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 18, 2022

hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-azure

In response to this:

hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure

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
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Added several inline comments.

@@ -280,9 +280,11 @@ func hcWorkloadUpdateStrategyToKv(hcObject *hcov1beta1.HyperConvergedWorkloadUpd
*kvObject.BatchEvictionSize = *hcObject.BatchEvictionSize
}

if size := len(hcObject.WorkloadUpdateMethods); size > 0 {
filterWorkloadUpdateMethods := filterWorkloadupdatemethods(hcObject.WorkloadUpdateMethods)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename to prevent name collision with the function, and improve readability.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 285 to 290
if size := len(filterWorkloadUpdateMethods); size > 0 {
kvObject.WorkloadUpdateMethods = make([]kubevirtcorev1.WorkloadUpdateMethod, size)
for i, updateMethod := range hcObject.WorkloadUpdateMethods {
for i, updateMethod := range filterWorkloadUpdateMethods {
kvObject.WorkloadUpdateMethods[i] = kubevirtcorev1.WorkloadUpdateMethod(updateMethod)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

check if the copy builtin function can be used here.

Copy link
Member Author

Choose a reason for hiding this comment

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

no because we also need a typecast between string and kubevirtcorev1.WorkloadUpdateMethod

@@ -291,6 +293,20 @@ func hcWorkloadUpdateStrategyToKv(hcObject *hcov1beta1.HyperConvergedWorkloadUpd
return kvObject
}

func filterWorkloadupdatemethods(workloadUpdateMethods []string) []string {
var filterWorkloadUpdateMethods []string
Copy link
Collaborator

Choose a reason for hiding this comment

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

please rename. Same name as the function - I find it confusing

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 298 to 310
for i := range workloadUpdateMethods {
if workloadUpdateMethods[i] == string(kubevirtcorev1.WorkloadUpdateMethodLiveMigrate) {
if hcoutil.GetClusterInfo().IsInfrastructureHighlyAvailable() {
filterWorkloadUpdateMethods = append(filterWorkloadUpdateMethods, workloadUpdateMethods[i])
}
} else {
filterWorkloadUpdateMethods = append(filterWorkloadUpdateMethods, workloadUpdateMethods[i])
}
}
return filterWorkloadUpdateMethods
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about this?

Suggested change
for i := range workloadUpdateMethods {
if workloadUpdateMethods[i] == string(kubevirtcorev1.WorkloadUpdateMethodLiveMigrate) {
if hcoutil.GetClusterInfo().IsInfrastructureHighlyAvailable() {
filterWorkloadUpdateMethods = append(filterWorkloadUpdateMethods, workloadUpdateMethods[i])
}
} else {
filterWorkloadUpdateMethods = append(filterWorkloadUpdateMethods, workloadUpdateMethods[i])
}
}
return filterWorkloadUpdateMethods
}
if hcoutil.GetClusterInfo().IsInfrastructureHighlyAvailable() {
copy(workloadUpdateMethods, workloadUpdateMethods)
} else {
for _, method := range workloadUpdateMethods {
if method != string(kubevirtcorev1.WorkloadUpdateMethodLiveMigrate) {
filterWorkloadUpdateMethods = append(filterWorkloadUpdateMethods, method)
}
}
}
return filterWorkloadUpdateMethods
}

Copy link
Member Author

Choose a reason for hiding this comment

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

nice, and we can even do better avoiding the copy at all if not on SNO

Explicitly filter out LiveMigrate
workloadUpdateMethod on SNO clusters.
On SNO cluster Live Migration FG is globally
disabled because we have a single worker node
but still we allow the user (and it's
the default) to pass
workloadUpdateMethod=["LiveMigrate"]
and this causes an infinite loop in
the upgrade handler in virt-controller
that currently ignores the LiveMigration FG.
Let's explicitly filter out LiveMigrate
workloadUpdateMethod to prevent the issue.

Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=2065308

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Mar 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@openshift-ci
Copy link

openshift-ci bot commented Mar 21, 2022

@tiraboschi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-upgrade-prev-index-sno-aws 95f1f2b link false /test hco-e2e-upgrade-prev-index-sno-aws
ci/prow/hco-e2e-upgrade-index-sno-aws 95f1f2b link false /test hco-e2e-upgrade-index-sno-aws

Full PR test history. Your PR dashboard.

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 21, 2022

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-aws, ci/prow/hco-e2e-upgrade-prev-index-sno-aws

In response to this:

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

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
Collaborator

@nunnatsa nunnatsa 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 kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 21, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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 Mar 21, 2022
@kubevirt-bot kubevirt-bot merged commit f7d4d37 into kubevirt:main Mar 21, 2022
@kubevirt-bot
Copy link
Contributor

@tiraboschi: new pull request created: #1825

In response to this:

/cherry-pick release-1.6

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.

@tiraboschi tiraboschi deleted the bz_2065308 branch April 1, 2022 15:58
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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants