Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Add cri managed image label when pulling the image.#1162

Merged
Random-Liu merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-image-pull
Jun 11, 2019
Merged

Add cri managed image label when pulling the image.#1162
Random-Liu merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-image-pull

Conversation

@Random-Liu
Copy link
Copy Markdown
Member

@Random-Liu Random-Liu commented Jun 10, 2019

Fixes #1161.

Add the cri managed image label when pulling the image.
Previously, we didn't add the image label when pulling the image, so the generated image create event also doesn't have the label:

time="2019-06-10T19:46:17.251529854Z" level=info msg="ImageCreate event &ImageCreate{Name:gcr.io/cri-tools/test-image-digest@sha256:9179135b4b4cc5a8721e09379244807553c318d92fa3111a65133241551ca343,Labels:map[string]string{},}" 

The cri plugin will create/update the image reference to add the label, and this may happen after PullImage returns.

If RemoveImage is called right after PullImage, there will be a race condition before RemoveImage and the event triggered image reference create/update. #1161 is caused just because the create/update happens after `RemoveImage.

Signed-off-by: Lantao Liu [email protected]

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

/LGTM
good catch

@Random-Liu Random-Liu merged commit 1275d6d into containerd:master Jun 11, 2019
@Random-Liu Random-Liu deleted the fix-image-pull branch June 11, 2019 17:51
Random-Liu added a commit that referenced this pull request Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRI Test Failure: public image with digest should be pulled and removed

3 participants