diff --git a/api/client/service/opts.go b/api/client/service/opts.go index f54c81b00a..00ede4d028 100644 --- a/api/client/service/opts.go +++ b/api/client/service/opts.go @@ -154,6 +154,9 @@ func (m *MountOpt) Set(value string) error { Labels: make(map[string]string), } } + if mount.VolumeOptions.DriverConfig == nil { + mount.VolumeOptions.DriverConfig = &swarm.Driver{} + } return mount.VolumeOptions } diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go index c9751caeff..ffe1ce6538 100644 --- a/daemon/cluster/executor/container/adapter.go +++ b/daemon/cluster/executor/container/adapter.go @@ -192,7 +192,7 @@ func (c *containerAdapter) createVolumes(ctx context.Context, backend executorpk continue } - if mount.VolumeOptions != nil { + if mount.VolumeOptions == nil { continue }