diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-06-13 09:34:56 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-06-13 09:34:56 -0400 |
commit | bcd95f9ddc9b15d24657b6549b10e55084501d41 (patch) | |
tree | cf4ac3b1a9dfada3edbd84a1d1ccd6b3ed731690 /libpod/container_inspect.go | |
parent | 4e7e5f5cbdfe343f99a76d12b221f390014266ed (diff) | |
download | podman-bcd95f9ddc9b15d24657b6549b10e55084501d41.tar.gz podman-bcd95f9ddc9b15d24657b6549b10e55084501d41.tar.bz2 podman-bcd95f9ddc9b15d24657b6549b10e55084501d41.zip |
Split mount options in inspect further
Docker only uses Mode for :z/:Z, so move other options out into a
new field.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r-- | libpod/container_inspect.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index e2450553c..0a62ceb7c 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -1,7 +1,6 @@ package libpod import ( - "strings" "time" "github.com/containers/libpod/libpod/driver" @@ -68,8 +67,12 @@ type InspectMount struct { Dst string `json:"Destination"` // The driver used for the named volume. Empty for bind mounts. Driver string `json:"Driver"` - // Mount options for the driver, excluding RO/RW and mount propagation. + // Contains SELinux :z/:Z mount options. Unclear what, if anything, else + // goes in here. Mode string `json:"Mode"` + // All remaining mount options. Additional data, not present in the + // original output. + Options []string `json:"Options"` // Whether the volume is read-write RW bool `json:"RW"` // Mount propagation for the mount. Can be empty if not specified, but @@ -369,6 +372,7 @@ func (c *Container) getInspectMounts() ([]*InspectMount, error) { func parseMountOptionsForInspect(options []string, mount *InspectMount) { isRW := true mountProp := "" + zZ := "" otherOpts := []string{} // Some of these may be overwritten if the user passes us garbage opts @@ -385,6 +389,8 @@ func parseMountOptionsForInspect(options []string, mount *InspectMount) { // Do nothing, silently discard case "shared", "slave", "private", "rshared", "rslave", "rprivate": mountProp = opt + case "z", "Z": + zZ = opt default: otherOpts = append(otherOpts, opt) } @@ -392,5 +398,6 @@ func parseMountOptionsForInspect(options []string, mount *InspectMount) { mount.RW = isRW mount.Propagation = mountProp - mount.Mode = strings.Join(otherOpts, ",") + mount.Mode = zZ + mount.Options = otherOpts } |