-
Notifications
You must be signed in to change notification settings - Fork 106
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
e2e:daemonset: pod phase and events #1289
base: master
Are you sure you want to change the base?
Conversation
testlog.Infof("daemonset %q %q desired %d scheduled %d ready %d", namespace, name, ds.Status.DesiredNumberScheduled, ds.Status.CurrentNumberScheduled, ds.Status.NumberReady) | ||
return ds.Status.DesiredNumberScheduled > 0 && ds.Status.DesiredNumberScheduled == ds.Status.NumberReady, nil | ||
isRunning := ds.Status.DesiredNumberScheduled > 0 && ds.Status.DesiredNumberScheduled == ds.Status.NumberReady | ||
if !isRunning { |
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.
style: everything else being equal, please align the happy path to the left: https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88
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.
The happy path is isRunning == true
which is the opposite of !isRunning
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 moved the logic into a separate function to make it more readable. I hope it's ok now
test/e2e/performanceprofile/functests/utils/daemonset/daemonset.go
Outdated
Show resolved
Hide resolved
3e0bea5
to
963cc89
Compare
thanks, we can go a step further (ofc not blocking)
|
Could you please highlight the diff from the existing implementation? |
Add context from the caller instead of local `context.TODO()`. Signed-off-by: Talor Itzhak <[email protected]>
Signed-off-by: Talor Itzhak <[email protected]>
less iterations means less spamming especially within the nodeinspector which log some data for every iteration. Signed-off-by: Talor Itzhak <[email protected]>
In case the DaemonSet's pods are not running for some reason, we want to log the pod's phase and event for better observability. This could help us with finding the root cause for the reason the pod didn't start. Signed-off-by: Talor Itzhak <[email protected]>
963cc89
to
7de0434
Compare
basically same logic, but keep pushing the happy path leftwards |
it does. unless I'm missing something |
/retest |
@Tal-or: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, Tal-or 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 |
/label acknowledge-critical-fixes-only test code can't break the product and actually helps improving the product quality |
In case the DaemonSet's pods are not running for some reason,
we want to log the pod's phase and event for
better observability.
This could help us with finding the root cause
for the reason the pod didn't start.
Signed-off-by: Talor Itzhak [email protected]