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
Bug 1986375: adding check for node exporter daemon set #1279
Conversation
pkg/client/client.go
Outdated
if condition.Type == v1.NodeReady { | ||
if condition.Status != v1.ConditionTrue { |
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
if condition.Type == v1.NodeReady { | |
if condition.Status != v1.ConditionTrue { | |
if condition.Type == v1.NodeReady && condition.Status != v1.ConditionTrue { |
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
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.
It might be worth looking if other fields in the daemonset's status wouldn't bring us the same information? In particular numberAvailable
and numberReady
...
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#daemonsetstatus-v1-apps
pkg/client/client.go
Outdated
nodes := nodeList.Items | ||
for _, node := range nodes { |
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) saving one line
nodes := nodeList.Items | |
for _, node := range nodes { | |
for _, node := range nodeList.Items { |
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
Scratch that, it doesn't seem to provide the information we need. |
pkg/client/client.go
Outdated
} | ||
} | ||
|
||
if d.Status.NumberUnavailable != 0 && d.Status.NumberUnavailable != nodeNotReadyCount { |
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.
another way to look at it would be to compare the number of ready nodes against NumberAvailable
. If there's a difference, CMO could log something like expected %d ready pods for %q daemonset, got only %d
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
pkg/client/client.go
Outdated
lastErr = errors.Errorf("got %d unavailable nodes", | ||
d.Status.NumberUnavailable) |
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.
lastErr = errors.Errorf("got %d unavailable nodes", | |
d.Status.NumberUnavailable) | |
lastErr = errors.Errorf("expected %d ready pods for %q daemonset, got only %d", | |
nodeReadyCount, ds.GetName(), d.Status.NumberAvailable) |
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
pkg/client/client.go
Outdated
d.Status.NumberUnavailable) | ||
|
||
var nodeReadyCount int32 | ||
nodeList, err := c.kclient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) |
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.
let's pass the context ctx
here instead of TODO()
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
pkg/client/client.go
Outdated
} | ||
|
||
if d.Status.NumberAvailable != nodeReadyCount { | ||
lastErr = errors.Errorf("expected %d ready pods for %q daemon set, got %d ", |
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.
lastErr = errors.Errorf("expected %d ready pods for %q daemon set, got %d ", | |
lastErr = errors.Errorf("expected %d ready pods for %q daemonset, got %d ", |
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
removing operator log code review comments correcting log message changing to use context instead of todo
/test e2e-agnostic |
@prashbnair: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
/lgtm |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/bugzilla refresh |
@prashbnair: No Bugzilla bug is referenced in the title of this pull request. 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. |
@prashbnair: This pull request references Bugzilla bug 1986375, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, prashbnair, simonpasquier 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 |
@prashbnair: All pull requests linked via external trackers have merged: Bugzilla bug 1986375 has been moved to the MODIFIED state. 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. |
removing operator log