-
Notifications
You must be signed in to change notification settings - Fork 0
Make the snapshotter configurable - review suggestions / ideas #48
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
Closed
thaJeztah
wants to merge
9
commits into
rumpl:snapshotter-configuration
from
thaJeztah:snapshotter_configuration_suggestions
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d15224e
Make the snapshotter configurable
rumpl b6770ed
c8d/daemon: Treat (storage/graph)Driver as snapshotter
vvoland 9b17bfa
daemon: move "imageroot" and "image-store" to where it's used
thaJeztah a6ca567
fix GoDoc for SnapshotterFromGraphDriver
thaJeztah 763463e
SnapshotterFromGraphDriver: fix name for windows graphdriver
thaJeztah 48616ea
SnapshotterFromGraphDriver: combine cases to single switch
thaJeztah 1b22029
TestSnapshotterFromGraphDriver: some refactoring
thaJeztah eecb4b1
daemon: use local variable for snapshotter name
thaJeztah a549834
ImageService.GraphDriverName(): return selected snapshotter name
thaJeztah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package containerd | ||
|
|
||
| import "github.com/containerd/containerd" | ||
|
|
||
| // SnapshotterFromGraphDriver returns the containerd snapshotter name based on | ||
| // the supplied graphdriver name. It handles both legacy names and translates | ||
| // them into corresponding containerd snapshotter names. | ||
| func SnapshotterFromGraphDriver(graphDriver string) string { | ||
| switch graphDriver { | ||
| case "overlay", "overlay2": | ||
| return "overlayfs" | ||
| case "windowsfilter": | ||
| return "windows" | ||
| case "": | ||
| return containerd.DefaultSnapshotter | ||
| default: | ||
| return graphDriver | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package containerd | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/containerd/containerd" | ||
| "gotest.tools/v3/assert" | ||
| ) | ||
|
|
||
| func TestSnapshotterFromGraphDriver(t *testing.T) { | ||
| testCases := []struct { | ||
| desc string | ||
| input string | ||
| expected string | ||
| }{ | ||
| { | ||
| desc: "empty defaults to containerd default", | ||
| input: "", | ||
| expected: containerd.DefaultSnapshotter, | ||
| }, | ||
| { | ||
| desc: "overlay -> overlayfs", | ||
| input: "overlay", | ||
| expected: "overlayfs", | ||
| }, | ||
| { | ||
| desc: "overlay2 -> overlayfs", | ||
| input: "overlay2", | ||
| expected: "overlayfs", | ||
| }, | ||
| { | ||
| desc: "windowsfilter -> windows", | ||
| input: "windowsfilter", | ||
| expected: "windows", | ||
| }, | ||
| { | ||
| desc: "containerd overlayfs", | ||
| input: "overlayfs", | ||
| expected: "overlayfs", | ||
| }, | ||
| { | ||
| desc: "containerd zfs", | ||
| input: "zfs", | ||
| expected: "zfs", | ||
| }, | ||
| { | ||
| desc: "unknown is unchanged", | ||
| input: "somefuturesnapshotter", | ||
| expected: "somefuturesnapshotter", | ||
| }, | ||
| } | ||
| for _, tc := range testCases { | ||
| tc := tc | ||
| t.Run(tc.desc, func(t *testing.T) { | ||
| assert.Equal(t, SnapshotterFromGraphDriver(tc.input), tc.expected) | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually a bug; at this point,
d.graphDriveris not yet set, so it would use an empty string; in the old code,d.graphDriverwas already set before;moby/daemon/daemon.go
Line 967 in 5de7704
moby/daemon/daemon.go
Lines 841 to 854 in 5de7704