-
Notifications
You must be signed in to change notification settings - Fork 149
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
Conversation
/cherry-pick release-1.6 |
@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:
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. |
Pull Request Test Coverage Report for Build 2014768203
💛 - Coveralls |
/retest |
hco-e2e-image-index-sno-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-azure In response to this:
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-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded. |
@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:
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. |
/retest |
hco-e2e-upgrade-index-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-azure In response to this:
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. |
There was a problem hiding this 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.
controllers/operands/kubevirt.go
Outdated
@@ -280,9 +280,11 @@ func hcWorkloadUpdateStrategyToKv(hcObject *hcov1beta1.HyperConvergedWorkloadUpd | |||
*kvObject.BatchEvictionSize = *hcObject.BatchEvictionSize | |||
} | |||
|
|||
if size := len(hcObject.WorkloadUpdateMethods); size > 0 { | |||
filterWorkloadUpdateMethods := filterWorkloadupdatemethods(hcObject.WorkloadUpdateMethods) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
controllers/operands/kubevirt.go
Outdated
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) | ||
} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
controllers/operands/kubevirt.go
Outdated
@@ -291,6 +293,20 @@ func hcWorkloadUpdateStrategyToKv(hcObject *hcov1beta1.HyperConvergedWorkloadUpd | |||
return kvObject | |||
} | |||
|
|||
func filterWorkloadupdatemethods(workloadUpdateMethods []string) []string { | |||
var filterWorkloadUpdateMethods []string |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
controllers/operands/kubevirt.go
Outdated
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 | ||
} |
There was a problem hiding this comment.
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?
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 | |
} |
There was a problem hiding this comment.
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>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@tiraboschi: The following tests failed, say
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-e2e-upgrade-index-sno-azure lane succeeded. |
@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:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[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 |
@tiraboschi: new pull request created: #1825 In response to this:
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. |
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
Release note: