-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Clarify VPA logging #2496
Clarify VPA logging #2496
Conversation
ginkgo.By("Verifying hamster deployment") | ||
for i, pod := range podList.Items { | ||
podInfo := fmt.Sprintf("pod at index %d", i) | ||
cpuDescription := fmt.Sprintf("%s: originally Pods had 100m CPU, admission controller should change it to recommended 250m CPU", podInfo) |
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 make the values into variables, so that we don't have to modify multiple places.
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
gomega.Expect(pod.Spec.Containers[0].Resources.Requests[apiv1.ResourceMemory]).To(gomega.Equal(ParseQuantityOrDie("200Mi"))) | ||
ginkgo.By("Verifying hamster deployment") | ||
for i, pod := range podList.Items { | ||
podInfo := fmt.Sprintf("pod at index %d", i) |
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.
Maybe just pod.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.
I'll add pod.Name but I want to keep pod index too. If the check always fails for pod with index 0 then likely always all pods would fail the check. If the check sometimes fails for pod with a higher index then we know that the problem can affect only some of pods in a deployment.
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.
AFAIR, the Expect will already say:
expected: this much,
got: this much
I think the only piece missing here for clarity is what we are this value of.
So I would much rather see a message that says for example "pod sth: resource request incorrect" or "pod sth: cpu limit ratio incorrect (not capped to limitrange max)"
I might remember wrong though. WDYT?
Errors look like:
For me it wasn't clear which is the actual value and which is expected value. |
6ecff20
to
d70ab95
Compare
d70ab95
to
e68b78c
Compare
Expected to equal seems quite clear to me (although it's the other way round than I remembered). I don't want to add too much there since the code gets cluttered IMO. |
Order isn't the only information missing from the log. It's also not saying what those values are (limit or request). I think we should log more details about the failure, looking it up in test code is painful. I added another commit, reducing amount of cluter a bit while trying to preserve most of information |
I was debugging some test failures and found the logs not clear enough. Move explanation of expectations from comments to logged description.
826eec5
to
4d6b0e0
Compare
/hold |
4d6b0e0
to
e1f0817
Compare
/hold cancel Tests seem to work after rebase |
Thanks a lot, this looks really good |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bskiba 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 |
No description provided.