Skip to content
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

Merged

Conversation

lucming
Copy link
Contributor

@lucming lucming commented Dec 16, 2022

Ⅰ. 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

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@lucming lucming force-pushed the optimize_logic_getnodestrategy branch 2 times, most recently from 93fe294 to 998b8a2 Compare December 16, 2022 10:22
@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Base: 66.49% // Head: 66.47% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (153d865) compared to base (7af9f66).
Patch coverage: 66.66% of modified lines in pull request are covered.

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              
Flag Coverage Δ
unittests 66.47% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/slo-controller/config/config.go 92.75% <66.66%> (-0.31%) ⬇️
pkg/koordlet/util/resourceexecutor/executor.go 37.19% <0.00%> (-2.48%) ⬇️
pkg/scheduler/plugins/coscheduling/core/gang.go 74.44% <0.00%> (-0.95%) ⬇️
pkg/koordlet/util/pod.go 53.75% <0.00%> (ø)
pkg/koordlet/util/node.go 45.00% <0.00%> (ø)
pkg/util/httputil/reverseproxy.go 85.10% <0.00%> (+0.79%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eahydra eahydra changed the title optimize logic of get node strategy koord-manager: optimize logic of get node strategy Dec 19, 2022
@@ -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 {
Copy link
Member

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.

Copy link
Contributor Author

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>
@lucming lucming force-pushed the optimize_logic_getnodestrategy branch from 998b8a2 to 153d865 Compare December 20, 2022 02:25
Copy link
Member

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@saintube
Copy link
Member

/lgtm

@hormes
Copy link
Member

hormes commented Dec 20, 2022

/approve

@koordinator-bot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit 97b18fb into koordinator-sh:main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants