Skip to content

Conversation

@fuweid
Copy link
Member

@fuweid fuweid commented May 28, 2024

Remove volatile option when CRI prepares image volumes.

Fixes: #10228

@fuweid fuweid added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels May 28, 2024
@fuweid fuweid changed the title core/mount: export RemoveVolatileOption as helper *: export RemoveVolatileOption for CRI image volumes May 28, 2024
@fuweid
Copy link
Member Author

fuweid commented May 28, 2024

=== RUN   TestContainerdImage
    containerd_image_test.go:44: make sure the test image doesn't exist in the cri plugin
    containerd_image_test.go:51: pull the image into containerd
    containerd_image_test.go:63: the image should be seen by the cri plugin
    containerd_image_test.go:120: the image should be marked as managed
    containerd_image_test.go:125: the image id should be created and managed
    containerd_image_test.go:130: the image should be labeled
    containerd_image_test.go:136: the image should be pinned
    containerd_image_test.go:142: should be able to start container with the image
E0528 15:19:22.528757   70056 remote_runtime.go:243] CreateContainer in sandbox "fa1e16854f1785618f13fb02da469f10a31537ab6e86bdf34163f32d7d5d0b7a" from runtime service failed: rpc error: code = NotFound desc = failed to create containerd container: error unpacking image: apply layer error for "ghcr.io/containerd/busybox:1.36": failed to extract layer sha256:869e6058ea58994b7c023f0f0a80f6dbb672ffc1cc61ef6c272f8dd573a76cc9: failed to get reader from content store: content digest sha256:f78e6840ded1aafb6c9f265f52c2fc7c0a990813ccf96702df84a7dcdbe48bea: not found
    containerd_image_test.go:151: 
        	Error Trace:	/home/runner/actions-runner/_work/containerd/containerd/integration/containerd_image_test.go:151
        	Error:      	Received unexpected error:
        	            	rpc error: code = NotFound desc = failed to create containerd container: error unpacking image: apply layer error for "ghcr.io/containerd/busybox:1.36": failed to extract layer sha256:869e6058ea58994b7c023f0f0a80f6dbb672ffc1cc61ef6c272f8dd573a76cc9: failed to get reader from content store: content digest sha256:f78e6840ded1aafb6c9f265f52c2fc7c0a990813ccf96702df84a7dcdbe48bea: not found
        	Test:       	TestContainerdImage
    containerd_image_test.go:96: image should still be seen by id if only tag get deleted
    containerd_image_test.go:107: image should be removed from the cri plugin if all references get deleted

@fuweid

This comment was marked as duplicate.

1 similar comment
@fuweid

This comment was marked as duplicate.

@fuweid

This comment was marked as duplicate.

@fuweid

This comment was marked as duplicate.

@fuweid
Copy link
Member Author

fuweid commented May 30, 2024

/test pull-containerd-k8s-e2e-ec2

Remove volatile option when CRI prepares image volumes.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
@fuweid
Copy link
Member Author

fuweid commented May 30, 2024

sorry to ping @pacoxu here. do you know how to debug the k8s e2e issue? no idea what it is.

@fuweid

This comment was marked as duplicate.

2 similar comments
@fuweid

This comment was marked as duplicate.

@fuweid

This comment was marked as duplicate.

@CormickKneey
Copy link

maybe more missed temp mount? why don't we just clean like this during each mount() as the work dir is static :

func cleanDirtyWorkerDir(opts []string) {
	var (
		idx    = -1
		prefix = "workdir="
	)

	for i, opt := range opts {
		if strings.HasPrefix(opt, prefix) {
			idx = i
			break
		}
	}

	if idx == -1 {
		return
	}
	// remove it if it exists
	os.RemoveAll(filepath.Join(opts[idx][len(prefix):], "work/incompat"))
}

@fuweid
Copy link
Member Author

fuweid commented May 30, 2024

maybe more missed temp mount? why don't we just clean like this during each mount() as the work dir is static :

It's not good idea to cleanup data especially when the snapshot is still active. And there is no contract to make sure that the work/incompat is deletable. So, I think removing option is better than cleanup dir.

@fuweid
Copy link
Member Author

fuweid commented May 30, 2024

/retest

@fuweid fuweid added this pull request to the merge queue May 30, 2024
Merged via the queue into containerd:main with commit 21c244d May 30, 2024
@fuweid fuweid deleted the fix-10228 branch May 30, 2024 22:49
@samuelkarp samuelkarp added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When the overlay volatile feature is enabled, creating a pod with an image configured with anonymous volumes will fail

6 participants