Browse code

fix 2 potential panics with mounts in swarm

Signed-off-by: Victor Vieux <vieux@docker.com>

Victor Vieux authored on 2016/06/15 01:25:39
Showing 2 changed files
... ...
@@ -154,6 +154,9 @@ func (m *MountOpt) Set(value string) error {
154 154
 				Labels: make(map[string]string),
155 155
 			}
156 156
 		}
157
+		if mount.VolumeOptions.DriverConfig == nil {
158
+			mount.VolumeOptions.DriverConfig = &swarm.Driver{}
159
+		}
157 160
 		return mount.VolumeOptions
158 161
 	}
159 162
 
... ...
@@ -192,7 +192,7 @@ func (c *containerAdapter) createVolumes(ctx context.Context, backend executorpk
192 192
 			continue
193 193
 		}
194 194
 
195
-		if mount.VolumeOptions != nil {
195
+		if mount.VolumeOptions == nil {
196 196
 			continue
197 197
 		}
198 198