-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix(sysadvisor): fix failed to find regions and pools #63
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
- Coverage 51.30% 51.22% -0.08%
==========================================
Files 318 325 +7
Lines 32418 33052 +634
==========================================
+ Hits 16632 16932 +300
- Misses 13840 14129 +289
- Partials 1946 1991 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
0105f93
to
7caf854
Compare
7caf854
to
dbb5f53
Compare
ab2e519
to
9f8b0ee
Compare
pkg/agent/sysadvisor/plugin/qosaware/resource/cpu/region/regulator/regulator.go
Outdated
Show resolved
Hide resolved
|
||
func (cra *cpuResourceAdvisor) getContainerRegions(ci *types.ContainerInfo) ([]region.QoSRegion, error) { | ||
regions := cra.getRegionsByRegionNames(ci.RegionNames) | ||
if len(regions) > 0 { |
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.
when will getRegionsByRegionNames
returns nil, but getRegionsByPodUID
has data?
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.
When a new container(sidecar as example) allocated, its regionNames are empty, so getRegionsByRegionNames
will returns nil. But its main continer has already assigned to specified region, so getRegionsByPodUID
returns the regions of main container
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.
okay, got it, maybe we'd better add those above as comments to clarify
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
9f8b0ee
to
c4e351b
Compare
1. The region names of containers belonging to the same pod should be the same, so we have to get region by podUID. 2. The regionNames in poolInfo should not be cleaned up when updatePoolInfo. Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
c4e351b
to
86888c7
Compare
1. The region names of containers belonging to the same pod should be the same, so we have to get region by podUID. 2. The regionNames in poolInfo should not be cleaned up when updatePoolInfo. Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
What type of PR is this?
Bug fixes
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer: