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
Add Virtual Machine name label to virt-launcher pod #7102
Add Virtual Machine name label to virt-launcher pod #7102
Conversation
/retest |
Hi @machadovilaca, can you please explain the motivation behind this change? (in the PR description) |
c0551a7
to
66a2ba9
Compare
66a2ba9
to
b053f39
Compare
@orelmisan description updated |
@machadovilaca Thank you! |
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.
I like this idea a lot. Thanks, great job!
Expect(len(pod.Spec.Containers)).To(Equal(1)) | ||
vmNameLabel, ok := pod.Labels[v1.VirtualMachineNameLabel] | ||
Expect(ok).To(BeTrue()) | ||
Expect(vmNameLabel).To(Equal("testvmi")) |
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.
nit: I would use vmi.Name(): Expect(vmNameLabel).To(Equal(vmi.Name()))
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.
updated
|
||
pod, err := svc.RenderLaunchManifest(&vmi) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(len(pod.Spec.Containers)).To(Equal(1)) |
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.
I think this line is redundant
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.
removed
pod, err := svc.RenderLaunchManifest(&vmi) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(len(pod.Spec.Containers)).To(Equal(1)) | ||
vmNameLabel, ok := pod.Labels[v1.VirtualMachineNameLabel] | ||
Expect(ok).To(BeTrue()) | ||
Expect(vmNameLabel).To(Equal("testvmi")) |
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.
same as above
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.
updated
@@ -3200,6 +3203,49 @@ var _ = Describe("Template", func() { | |||
Expect(pod.Spec.Containers[0].Resources.Requests.Memory().Value()).To(Equal(expectedMemory.Value())) | |||
}) | |||
}) | |||
|
|||
Context("with Virtual Machine name label in the template", func() { |
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.
I think that using "template" in here is confusing and out of context.
Maybe "with Virtual Machine name label annotation" would be better.
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.
removed in the template
}) | ||
}) | ||
|
||
Context("without Virtual Machine name label in the template", func() { |
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.
same as above
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.
removed in the template
b053f39
to
2504610
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.
Great job!
/lgtm
One nit below, you don't have to use it - up to you.
|
||
pod, err := svc.RenderLaunchManifest(&vmi) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(len(pod.Spec.Containers)).To(Equal(1)) |
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.
nit: You can change it to Expect(pod.Spec.Containers).To(HaveLen(1))
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.
updated
2504610
to
3f59394
Compare
/lgtm |
/retest |
3 similar comments
/retest |
/retest |
/retest |
/retest |
/lgtm |
/assign @stu-gott |
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
39b3e9b
to
a11c1e2
Compare
/lgtm |
/ok-to-test |
@machadovilaca: The following tests 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. |
/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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stu-gott 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 |
/cherrypick release-0.49 |
@machadovilaca: #7102 failed to apply on top of branch "release-0.49":
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. |
/cherrypick release-0.50 |
@machadovilaca: #7102 failed to apply on top of branch "release-0.50":
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. |
Adding this label will allow monitoring systems to correlate the
virt-launcher
pods running the VMs and the VMs themselves.We should guarantee that if the user is not using an internal template with predefined labels, we will still ensure we have this information
/cc @sradco
Signed-off-by: João Vilaça jvilaca@redhat.com
What this PR does / why we need it:
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: