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

bugfix: container log path map not initialized for existing businesses #2559

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Dec 13, 2018

Signed-off-by: Starnop [email protected]

Ⅰ. Describe what this PR did

For existing businesses, ContainerLogMap has not been initialized which will cause panic, so fix it.

Ⅱ. Does this pull request fix one issue?

None.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

None.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #2559 into master will increase coverage by 0.11%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2559      +/-   ##
=========================================
+ Coverage   69.09%   69.2%   +0.11%     
=========================================
  Files         278     278              
  Lines       18582   18564      -18     
=========================================
+ Hits        12839   12847       +8     
+ Misses       4270    4256      -14     
+ Partials     1473    1461      -12
Flag Coverage Δ
#criv1alpha1test 31.3% <0%> (+0.2%) ⬆️
#criv1alpha2test 35.63% <88.88%> (+0.17%) ⬆️
#integrationtest 40.57% <0%> (ø) ⬆️
#nodee2etest 32.64% <77.77%> (+0.13%) ⬆️
#unittest 26.81% <0%> (+0.01%) ⬆️
Impacted Files Coverage Δ
cri/v1alpha2/cri_utils.go 89.44% <ø> (-0.04%) ⬇️
cri/v1alpha2/cri_types.go 100% <ø> (ø) ⬆️
cri/v1alpha2/cri.go 69.71% <88.88%> (+1.12%) ⬆️
pkg/streams/utils.go 82.14% <0%> (-9.53%) ⬇️
pkg/meta/store.go 67.44% <0%> (-1.56%) ⬇️
daemon/mgr/container_utils.go 83.92% <0%> (-1.2%) ⬇️
cri/v1alpha2/cri_wrapper.go 65.59% <0%> (ø) ⬆️
daemon/mgr/container.go 58.65% <0%> (+0.21%) ⬆️
cri/v1alpha1/cri.go 60.59% <0%> (+0.33%) ⬆️
... and 5 more

@pouchrobot pouchrobot added areas/log kind/bug This is bug report for project size/M labels Dec 13, 2018
@pouchrobot pouchrobot added size/L and removed size/M labels Dec 13, 2018
logPath, ok := sandboxMeta.ContainerLogMap[containerID]
if !ok {
logPath, ok := container.Config.Labels[containerLogPathLabelKey]
if !ok || logPath == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

just checkout logPath is empty here. No matter ok is true or false. right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has been updated.

@starnop starnop force-pushed the bugfix-configmap branch 2 times, most recently from ffe4b17 to 3c2825a Compare December 13, 2018 11:35
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@rudyfly rudyfly merged commit 3e77989 into AliyunContainerService:master Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/log kind/bug This is bug report for project size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants