-
Notifications
You must be signed in to change notification settings - Fork 312
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
koord-manager: optimize logic of get node strategy #888
koord-manager: optimize logic of get node strategy #888
Conversation
93fe294
to
998b8a2
Compare
Codecov ReportBase: 66.49% // Head: 66.47% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #888 +/- ##
==========================================
- Coverage 66.49% 66.47% -0.02%
==========================================
Files 233 233
Lines 26757 26754 -3
==========================================
- Hits 17791 17785 -6
- Misses 7707 7710 +3
Partials 1259 1259
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
pkg/slo-controller/config/config.go
Outdated
@@ -189,20 +189,23 @@ func GetNodeColocationStrategy(cfg *ColocationCfg, node *corev1.Node) *Colocatio | |||
|
|||
nodeLabels := labels.Set(node.Labels) | |||
for _, nodeCfg := range cfg.NodeConfigs { | |||
if nodeCfg.NodeSelector == 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.
A nil NodeSelector is translated to match nothing via LabelSelectorAsSelector()
. Maybe we do not need to check if it is 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.
en,indeed.
Signed-off-by: lucming <2876757716@qq.com>
998b8a2
to
153d865
Compare
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
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hormes 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 |
Ⅰ. Describe what this PR does
Just rearranging the logic for getting the node strategy. It maybe easier to read when written like this.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews
V. Checklist
make test