Skip to content

Commit

Permalink
When you change the storage driver we ignore the storage-options
Browse files Browse the repository at this point in the history
The storage driver and the storage options in storage.conf should
match, but if you change the storage driver via the command line
then we need to nil out the default storage options from storage.conf.

If the user wants to change the storage driver and use storage options,
they need to specify them on the command line.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 8, 2019
1 parent 6109de4 commit 629017b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/podman/libpodruntime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ func getRuntime(ctx context.Context, c *cliconfig.PodmanCommand, renumber bool,
if c.Flags().Changed("storage-driver") {
storageSet = true
storageOpts.GraphDriverName = c.GlobalFlags.StorageDriver
// Overriding the default storage driver caused GraphDriverOptions from storage.conf to be ignored
storageOpts.GraphDriverOptions = []string{}
}
// This should always be checked after storage-driver is checked
if len(c.GlobalFlags.StorageOpts) > 0 {
storageSet = true
storageOpts.GraphDriverOptions = c.GlobalFlags.StorageOpts
Expand Down
3 changes: 2 additions & 1 deletion libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ func (c *Container) setupStorage(ctx context.Context) error {
}
return false
}
defOptions, err := storage.GetDefaultMountOptions()

defOptions, err := storage.GetMountOptions(c.runtime.store.GraphDriverName(), c.runtime.store.GraphOptions())
if err != nil {
return errors.Wrapf(err, "error getting default mount options")
}
Expand Down

0 comments on commit 629017b

Please sign in to comment.