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

CNV-49299: use runStrategy on cloning #2217

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

upalatucci
Copy link
Member

📝 Description

spec.running and spec.runStrategy are mutual exclusive. YAML example now use spec.runStrategy so patching the VM with spec.running: true does not work. So if the VM use spec.running patch that spec attribute otherwise use spec.runStrategy

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 7, 2024

@upalatucci: This pull request references CNV-49299 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set.

In response to this:

📝 Description

spec.running and spec.runStrategy are mutual exclusive. YAML example now use spec.runStrategy so patching the VM with spec.running: true does not work. So if the VM use spec.running patch that spec attribute otherwise use spec.runStrategy

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from metalice and pcbailey October 7, 2024 12:49
@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Oct 7, 2024
@metalice
Copy link
Member

metalice commented Oct 7, 2024

@upalatucci, why not just change the example yaml? Its ours isn't it? or you are thinking about a case of user yaml with runstrategy ?

@upalatucci
Copy link
Member Author

upalatucci commented Oct 7, 2024

spec.runStrategy is the modern way to define the VM behavior. We should always use that instead of spec.running. It gives the user more flexibility on how the VM should behave in case of failures. This is why the example yaml was changed from spec.running to spec.runStrategy.
Other than that, I think our code should be flexible and be able to start vms that use both mechanisms

const vmUseRunning = useMemo(
() =>
(source as V1VirtualMachine)?.spec?.running !== undefined &&
(source as V1VirtualMachine)?.spec?.running !== null,
Copy link
Member

Choose a reason for hiding this comment

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

What about when running can be false? there are also cases where someone would like to pass a different runStrategy the Always?

Copy link
Member Author

Choose a reason for hiding this comment

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

If rspec.running is false, it means that the user used this attribute to run/stop the VM so we'll use the same s[attribute changing the spec.running . If it's not in the vm spec it means that we'll use runStrategy

I can at this point call the vm API action to run the vm, so the backend will choose what strategy use.

Copy link
Member Author

Choose a reason for hiding this comment

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

runStrategies that start vms are Always and RerunOnFailure

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Oct 20, 2024
Copy link
Contributor

openshift-ci bot commented Oct 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: metalice, upalatucci

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:
  • OWNERS [metalice,upalatucci]

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

@openshift-merge-bot openshift-merge-bot bot merged commit 63503da into kubevirt-ui:main Oct 20, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is something we want to fix jira/valid-reference lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants