-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix guest memory setting #8367
fix guest memory setting #8367
Conversation
/cc @rmohr @davidvossel |
15e82de
to
b2090c1
Compare
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.
This makes sense and will also help we cases when we need to provide both requests and limits.
I have one suggestion on how to simplify the test.
tests/vmi_configuration_test.go
Outdated
Expect(domXml).To(ContainSubstring(expectedMemoryXMLStr)) | ||
|
||
}, | ||
Entry("provided by domain spec directly", pointer.Int(512), nil, nil), |
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.
This could be simpler by using options. WithGuestMemory
, WithLimitMemory
WithResourceMemory
. You just need to use New
rather than NewAlpine
to not get the default.
tests/vmi_configuration_test.go
Outdated
@@ -624,8 +681,10 @@ var _ = Describe("[sig-compute]Configurations", func() { | |||
Context("[rfe_id:140][crit:medium][vendor:cnv-qe@redhat.com][level:component]with diverging memory limit from memory request and no guest memory", func() { | |||
It("[test_id:3115]should show the memory limit inside the VMI", func() { | |||
vmi := libvmi.NewCirros() | |||
vmi.Spec.Domain.Resources.Limits = kubev1.ResourceList{ | |||
kubev1.ResourceMemory: resource.MustParse("256Mi"), | |||
vmi.Spec.Domain.Resources = v1.ResourceRequirements{ |
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.
This is overriding the memory, do we want it? Let's change the name if we do.
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.
Thanks, yeah.
Changed
Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
b2090c1
to
db05592
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xpivarc 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 |
/retest |
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.
/lgtm
@vladikr: The following test failed, say
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. |
What this PR does / why we need it:
It appears that we are incorrectly setting the guest memory to equal
resources.limits.memory
.VMI specs that don't explicitly provide a value for
domain.memory.guest
and provide different values for resources requests and limits will be converted to a domain definition where guest memory equals
resources.limits.memory
.Special notes for your reviewer:
From my recollection, we used to have a vmi mutator webhook that set the correct value, but I don't see it right now.
Release note: