fix(stargz-snapshotter): set default root path #452
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the default root path parameter to stargz-snapshotter extension as an argument:
--root
. It sets the path to /var/lib/containerd/io.containerd.snapshotter.v1.stargz as it is a more common place to find it. The snapshotter default path is defined in stargz-snapshotter/cmd/containerd-stargz-grpc/main.go#L66 and points to /var/lib/containerd-stargz-grpc.Motivation
When trying the stargz-snapshotter extension I found some errors and seemed that the snapshotter wasn't working properly. I didn't copy the errors but they were something in the lines of:
Investigation
Searching around I found some issues:
The last of the issues listed above pointed me to the right track. There is a linked PR (containerd/containerd#10127) where it is added to containerd the functionality to inform the remote snapshotter's root dir. Although it is advised to point it (if possible) to /var/lib/containerd/ for better compatibility.
containerd/nydus-snapshotter#288 (comment)
Testing
I've built the extension with the change, then built an installer image and upgraded a testing cluster with it. After it all the logs seemed normal. Also these logs from the CRI stream, leads me to think that cleanup of stale snapshots is working as expected: