-
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
Make the snapshotter configurable - review suggestions / ideas #48
Conversation
Signed-off-by: Djordje Lukic <[email protected]>
Also moved some layerStore related initialization to the non-c8d case because otherwise they get treated as a graphdriver plugins. Signed-off-by: Paweł Gronowski <[email protected]>
daemon/daemon.go
Outdated
| imageRoot := filepath.Join(config.Root, "image", layerStore.DriverName()) | ||
| ifs, err := image.NewFSStoreBackend(filepath.Join(imageRoot, "imagedb")) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
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.
Perhaps this should even be further down (line 1040); I wasn't 100% sure though if some of the other code depended on side-effects of this (creating the directories)
3776925 to
8ddfa5d
Compare
daemon: move image-store creation to where it's used; imageRoot should not be set _before_ the graphdriver name is set, otherwise it may be empty, and would make it use `/var/lib/docker/image` instead of `/var/lib/docker/image/<storage-driver>/` Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
- use early return - combine all cases to a single switch - don't trim io.containerd.snapshotter.v1 prefix, as containerd itself does not currently support fully-qualified plugin names either (we may consider adding support for it in future) Signed-off-by: Sebastiaan van Stijn <[email protected]>
- make sure to de-reference the whole struct - use gotest.tools - rename variables for consistency/clarity Signed-off-by: Sebastiaan van Stijn <[email protected]>
Reduce the use of daemon.graphDriver field, which should be removed. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
8ddfa5d to
a549834
Compare
daemon/daemon.go
Outdated
| imageRoot := filepath.Join(config.Root, "image", d.graphDriver) | ||
|
|
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.graphDriver is not yet set, so it would use an empty string; in the old code, d.graphDriver was already set before;
Line 967 in 5de7704
| imageRoot := filepath.Join(config.Root, "image", d.graphDriver) |
Lines 841 to 854 in 5de7704
| if isWindows { | |
| // On Windows we don't support the environment variable, or a user supplied graphdriver | |
| d.graphDriver = "windowsfilter" | |
| } else { | |
| // Unix platforms however run a single graphdriver for all containers, and it can | |
| // be set through an environment variable, a daemon start parameter, or chosen through | |
| // initialization of the layerstore through driver priority order for example. | |
| if drv := os.Getenv("DOCKER_DRIVER"); drv != "" { | |
| d.graphDriver = drv | |
| logrus.Infof("Setting the storage driver from the $DOCKER_DRIVER environment variable (%s)", drv) | |
| } else { | |
| d.graphDriver = config.GraphDriver // May still be empty. Layerstore init determines instead. | |
| } | |
| } |
f060068 to
e645f73
Compare
relates to #40