Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
| ... | ... |
@@ -212,6 +212,20 @@ func (d *driver) setupRlimits(container *configs.Config, c *execdriver.Command) |
| 212 | 212 |
} |
| 213 | 213 |
|
| 214 | 214 |
func (d *driver) setupMounts(container *configs.Config, c *execdriver.Command) error {
|
| 215 |
+ userMounts := make(map[string]struct{})
|
|
| 216 |
+ for _, m := range c.Mounts {
|
|
| 217 |
+ userMounts[m.Destination] = struct{}{}
|
|
| 218 |
+ } |
|
| 219 |
+ |
|
| 220 |
+ // Filter out mounts that are overriden by user supplied mounts |
|
| 221 |
+ var defaultMounts []*configs.Mount |
|
| 222 |
+ for _, m := range container.Mounts {
|
|
| 223 |
+ if _, ok := userMounts[m.Destination]; !ok {
|
|
| 224 |
+ defaultMounts = append(defaultMounts, m) |
|
| 225 |
+ } |
|
| 226 |
+ } |
|
| 227 |
+ container.Mounts = defaultMounts |
|
| 228 |
+ |
|
| 215 | 229 |
for _, m := range c.Mounts {
|
| 216 | 230 |
dest, err := symlink.FollowSymlinkInScope(filepath.Join(c.Rootfs, m.Destination), c.Rootfs) |
| 217 | 231 |
if err != nil {
|