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: use image reference during ContainerStatus #2096

Merged
merged 1 commit into from
Aug 15, 2018
Merged

bugfix: use image reference during ContainerStatus #2096

merged 1 commit into from
Aug 15, 2018

Conversation

fuweid
Copy link
Contributor

@fuweid fuweid commented Aug 14, 2018

Signed-off-by: Wei Fu fhfuwei@163.com

Ⅰ. Describe what this PR did

If user repush image with the same reference, the image ID will be changed. For now, pouch daemon will remove the old image ID so that CRI fails to fetch the running container. Before upgrade pouch daemon image manager, we use reference to get image instead of id.

Ⅱ. Does this pull request fix one issue?

NONE

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

NO

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@fuweid fuweid requested a review from YaoZengzeng August 14, 2018 11:58
@pouchrobot pouchrobot added kind/bug This is bug report for project size/S labels Aug 14, 2018
If user repush image with the same reference, the image ID will
be changed. For now, pouch daemon will remove the old image ID
so that CRI fails to fetch the running container. Before upgrade
pouch daemon image manager, we use reference to get image instead of
id.

Signed-off-by: Wei Fu <fhfuwei@163.com>
@codecov-io
Copy link

codecov-io commented Aug 14, 2018

Codecov Report

Merging #2096 into master will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2096      +/-   ##
==========================================
- Coverage   65.35%   65.33%   -0.02%     
==========================================
  Files         207      207              
  Lines       16226    16226              
==========================================
- Hits        10605    10602       -3     
- Misses       4311     4315       +4     
+ Partials     1310     1309       -1
Flag Coverage Δ
#criv1alpha1test 33.44% <33.33%> (-0.05%) ⬇️
#criv1alpha2test 34.11% <33.33%> (+0.02%) ⬆️
#integrationtest 40.04% <0%> (-0.04%) ⬇️
#unittest 23.88% <0%> (ø) ⬆️
Impacted Files Coverage Δ
cri/v1alpha1/cri.go 64.22% <66.66%> (ø) ⬆️
cri/v1alpha2/cri.go 65.06% <66.66%> (ø) ⬆️
cri/stream/httpstream/spdy/upgrade.go 54.28% <0%> (-5.72%) ⬇️
ctrd/image.go 76.75% <0%> (-2.2%) ⬇️
daemon/logger/jsonfile/utils.go 73.17% <0%> (+1.62%) ⬆️
ctrd/watch.go 75.75% <0%> (+3.03%) ⬆️

@allencloud
Copy link
Collaborator

Could you help to review this? @xiechengsheng
Thanks a lot. 🍻

@xiechengsheng
Copy link
Contributor

I'm sorry I have no idea what the repush in code comment means. Maybe mean pouch commit opreation(image reference not changed but id changed)? If so, then this pr looks good to merge for my part.

}
imageRef := imageInfo.ID
Copy link
Contributor

Choose a reason for hiding this comment

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

Emmm, I think we could directly use imageID variable name here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If user has changed Dockerfile and re-builds it with the same reference, the imageID will be changed. This is tricky part that we use reference to GetImage to make sure that ContainerStatus can be successfully executed after imageID was changed. That is why that we should use imageInfo.ID here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know what you mean, what I want to say is should we use imageID := imageInfo.ID here to avoid the misunderstanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CRI defines the imageRef in the protobuf. we just follow the rule here.

Copy link
Contributor

@YaoZengzeng YaoZengzeng left a comment

Choose a reason for hiding this comment

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

LGTM

@allencloud
Copy link
Collaborator

LGTM

@allencloud allencloud merged commit 18df365 into AliyunContainerService:master Aug 15, 2018
@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 15, 2018
@fuweid fuweid deleted the bugfix_use_config_image_instead_of_id branch August 22, 2018 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants