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
Added: publishing events for topologyAwareHints changes #113544
Added: publishing events for topologyAwareHints changes #113544
Conversation
Welcome @LiorLieberman! |
Hi @LiorLieberman. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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.
Thanks @LiorLieberman! These changes mostly LGTM, just a few nits. A few overall requests on the PR as well:
- Please squash the commits down to a single one (or small set if that provides a clearer story).
- Please fill out the relevant fields in the PR description, especially the release note section.
- Please link to Topology Aware Routing enhancements#2433 as the enhancement issue
- Remove WIP from the title whenever you think this is ready
be75404
to
7562e87
Compare
if t.cpuRatiosByZone == nil { | ||
return nil, &EventBuilder{ | ||
EventType: v1.EventTypeWarning, | ||
Reason: "TopologyAwareHintsDisabled", | ||
Message: InsufficientNodeInfo, | ||
} | ||
} | ||
if len(t.cpuRatiosByZone) < 2 { | ||
return nil, &EventBuilder{ | ||
EventType: v1.EventTypeWarning, | ||
Reason: "TopologyAwareHintsDisabled", | ||
Message: NodesReadyInOneZoneOnly, | ||
} | ||
} | ||
if len(t.cpuRatiosByZone) > numEndpoints { | ||
return nil, &EventBuilder{ | ||
EventType: v1.EventTypeWarning, | ||
Reason: "TopologyAwareHintsDisabled", | ||
Message: fmt.Sprintf("%s (%d endpoints, %d zones)", InsufficientNumberOfEndpoints, numEndpoints, len(t.cpuRatiosByZone)), | ||
} | ||
} |
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.
what if we aggregate here, if we return fast we miss the other checks, that are another reason for not having hints too.
My point is if I'm using this and I hit this 3 problems, I will have to fix 1 by 1, if I see the 3 errors I may fix all of them
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.
+1, having information about all 3 would be very useful.
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.
You suggest to publish all 3 events right? not one that contains all of them
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.
your call, I don't have strong opinion, Swetha or Rob may have some ideas
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.
@aojea @swetharepakula thinking further, it is not a good place to aggregate as all these events are mutually exclusive. you could see we check t.cpuRatiosByZone
in all of them.
Moreover, if its nil, we will get exception checking for its length in the next condition.
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.
You're right. I think how it is makes sense. Thanks!
48c4ac5
to
4faede0
Compare
Thanks @LiorLieberman! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LiorLieberman, robscott 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 |
/retest |
LGTM. Thanks @LiorLieberman ! |
What type of PR is this?
/kind feature
What this PR does / why we need it:
See PR title
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Enhancement Issue: kubernetes/enhancements#2433