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

flavors: Raise conflict if CPU or Memory resource requests are present when using flavors #7981

Merged

Conversation

lyarwood
Copy link
Member

@lyarwood lyarwood commented Jun 23, 2022

What this PR does / why we need it:

Previously a user could request both the use of a flavor that defines a guest visible amount of CPU/Memory and separate resource requests for CPU and memory within the associated VirtualMachine.

This obviously isn't desirable as there is no guarantee these requests could work together. For now a conflict should be raised. In the future flavors should be extended to support both methods of defining resources, allowing us to ensure that the requests are viable before application to the VirtualMachineInstance.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Conflicts will now be raised when using flavors if the `VirtualMachine` defines any `CPU` or `Memory` resource requests.

@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/L labels Jun 23, 2022
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2022
@lyarwood lyarwood changed the title Flavors: Raise conflict if CPU or Memory resource requests are present when using flavors flavors: Raise conflict if CPU or Memory resource requests are present when using flavors Jun 24, 2022
@lyarwood lyarwood force-pushed the flavor-resource-request-conflict branch from be18d76 to a83b09f Compare June 24, 2022 09:31
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2022
@lyarwood
Copy link
Member Author

/recheck

@lyarwood
Copy link
Member Author

/retest

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.

Overall this looks good.

tests/flavor_test.go Outdated Show resolved Hide resolved
@lyarwood lyarwood force-pushed the flavor-resource-request-conflict branch from a83b09f to 053dd5b Compare June 30, 2022 09:08
@stu-gott
Copy link
Member

/lgtm

@kubevirt-bot kubevirt-bot added lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 30, 2022
We shouldn't allow users to provide resource requests for vCPUs when
using a flavor that also defines vCPUs. Reject the request with a
conflict if this is the case.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@lyarwood lyarwood force-pushed the flavor-resource-request-conflict branch from 053dd5b to 369c005 Compare July 4, 2022 12:06
@kubevirt-bot kubevirt-bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 4, 2022
As with CPU resource requests we should also raise a conflict if memory
resource requests are present.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@lyarwood lyarwood force-pushed the flavor-resource-request-conflict branch from 369c005 to ea60465 Compare July 5, 2022 13:43
@lyarwood
Copy link
Member Author

lyarwood commented Jul 5, 2022

/cc @davidvossel @akrejcir

@lyarwood
Copy link
Member Author

lyarwood commented Jul 6, 2022

/retest

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidvossel

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 Jul 8, 2022
@kubevirt-commenter-bot
Copy link

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

2 similar comments
@kubevirt-commenter-bot
Copy link

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

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required 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 Jul 9, 2022

@lyarwood: 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
pull-kubevirt-fossa ea60465 link false /test pull-kubevirt-fossa
pull-kubevirt-code-lint ea60465 link false /test pull-kubevirt-code-lint

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-commenter-bot
Copy link

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

@kubevirt-bot kubevirt-bot merged commit 7dd5ff8 into kubevirt:main Jul 9, 2022
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.

5 participants