summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-04-23 15:35:38 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-01 10:19:05 -0400
commit70beb57faa1cfb1a2e9be411628477bc1618c3cf (patch)
tree73768007a5ba527a30795a67fedbe2b4c00ac3fb /pkg/spec
parent2e00d417dd87dd6648f6c3b604fd25db0c05d9f1 (diff)
downloadpodman-70beb57faa1cfb1a2e9be411628477bc1618c3cf.tar.gz
podman-70beb57faa1cfb1a2e9be411628477bc1618c3cf.tar.bz2
podman-70beb57faa1cfb1a2e9be411628477bc1618c3cf.zip
Fix options for non-bind and non-tmpfs volumes
We were unconditionally resetting volume mount options for all mount points (and by the looks of things, completely dropping tmpfs mounts), which was causing runc to refuse to run containers and all the tests to consequently fail. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/storage.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/pkg/spec/storage.go b/pkg/spec/storage.go
index 7806a8c72..6f8398513 100644
--- a/pkg/spec/storage.go
+++ b/pkg/spec/storage.go
@@ -100,6 +100,8 @@ func (config *CreateConfig) parseVolumes(runtime *libpod.Runtime) ([]spec.Mount,
unifiedMounts[dest] = tmpfs
}
+ // TODO: Check for conflicts between volumes and named volumes.
+
// If requested, add container init binary
if config.Init {
initPath := config.InitPath
@@ -143,6 +145,9 @@ func (config *CreateConfig) parseVolumes(runtime *libpod.Runtime) ([]spec.Mount,
finalVolumes = append(finalVolumes, volume)
}
+ logrus.Debugf("Got mounts: %v", finalMounts)
+ logrus.Debugf("Got volumes: %v", finalVolumes)
+
return finalMounts, finalVolumes, nil
}
@@ -377,9 +382,6 @@ func getBindMount(args []string) (spec.Mount, error) {
newMount.Source = newMount.Destination
}
- // Process options
- newMount.Options = processOptions(newMount.Options)
-
return newMount, nil
}
@@ -579,7 +581,7 @@ func (config *CreateConfig) getVolumeMounts() (map[string]spec.Mount, map[string
Destination: dest,
Type: string(TypeBind),
Source: src,
- Options: processOptions(options),
+ Options: options,
}
if _, ok := mounts[newMount.Destination]; ok {
return nil, nil, errors.Wrapf(errDuplicateDest, newMount.Destination)
@@ -754,12 +756,13 @@ func supercedeUserMounts(mounts []spec.Mount, configMount []spec.Mount) []spec.M
func initFSMounts(inputMounts []spec.Mount) []spec.Mount {
var mounts []spec.Mount
for _, m := range inputMounts {
- m.Options = processOptions(m.Options)
- if m.Type == "tmpfs" {
+ if m.Type == TypeBind {
+ m.Options = processOptions(m.Options)
+ }
+ if m.Type == TypeTmpfs {
m.Options = append(m.Options, "tmpcopyup")
- } else {
- mounts = append(mounts, m)
}
+ mounts = append(mounts, m)
}
return mounts
}