-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use NodeSystemInfo rather than node labels #152
base: main
Are you sure you want to change the base?
Conversation
87e9e98
to
361a315
Compare
361a315
to
0bf78ae
Compare
Signed-off-by: Raul Sevilla <[email protected]>
0bf78ae
to
c50f9d7
Compare
return npl, fmt.Errorf("❌ Failure to capture deployment: %v", err) | ||
} | ||
selector, err := metav1.LabelSelectorAsSelector(d.Spec.Selector) | ||
info.NodeName = pods.Items[0].Spec.NodeName |
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.
We just pick the first pod of the list
return npl, fmt.Errorf("❌ Failure to capture pods: %v", err) | ||
} | ||
for pod := range pods.Items { | ||
if pods.Items[pod].DeletionTimestamp != 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.
There's no need to check DeletionTimestamp
as pod has a Running status already
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.
Trying to recall why I had this -- I recall some weird situation with cleanup and running over and over again...
Type of change
Description
Since that labels can be tricky and very verbose, let's use the NodeSystemInfo struct, which contains the info we need
Example documents: https://termbin.com/hlp5
Also consolidating some functions (GetNakedPodNodeInfo and GetNakedPods) into a single one
Related Tickets & Documents
Checklist before requesting a review
Testing