mirror of https://github.com/containers/podman.git
Show volume options in 'volume inspect'
We initialized the map to show them, but didn't actually copy them in, so they weren't being displayed. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
parent
e7d5ac0e75
commit
6456f6da17
|
@ -62,6 +62,9 @@ func (v *Volume) Inspect() (*InspectVolumeData, error) {
|
||||||
}
|
}
|
||||||
data.Scope = v.Scope()
|
data.Scope = v.Scope()
|
||||||
data.Options = make(map[string]string)
|
data.Options = make(map[string]string)
|
||||||
|
for k, v := range v.config.Options {
|
||||||
|
data.Options[k] = v
|
||||||
|
}
|
||||||
data.UID = v.config.UID
|
data.UID = v.config.UID
|
||||||
data.GID = v.config.GID
|
data.GID = v.config.GID
|
||||||
data.ContainerSpecific = v.config.IsCtrSpecific
|
data.ContainerSpecific = v.config.IsCtrSpecific
|
||||||
|
|
|
@ -2,6 +2,7 @@ package integration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
. "github.com/containers/libpod/test/utils"
|
. "github.com/containers/libpod/test/utils"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
|
@ -74,4 +75,16 @@ var _ = Describe("Podman volume inspect", func() {
|
||||||
Expect(session.OutputToStringArray()[0]).To(Equal(volName1))
|
Expect(session.OutputToStringArray()[0]).To(Equal(volName1))
|
||||||
Expect(session.OutputToStringArray()[1]).To(Equal(volName2))
|
Expect(session.OutputToStringArray()[1]).To(Equal(volName2))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("inspect volume finds options", func() {
|
||||||
|
volName := "testvol"
|
||||||
|
session := podmanTest.Podman([]string{"volume", "create", "--opt", "type=tmpfs", volName})
|
||||||
|
session.WaitWithDefaultTimeout()
|
||||||
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
|
inspect := podmanTest.Podman([]string{"volume", "inspect", volName})
|
||||||
|
inspect.WaitWithDefaultTimeout()
|
||||||
|
Expect(inspect.ExitCode()).To(Equal(0))
|
||||||
|
Expect(strings.Contains(inspect.OutputToString(), "tmpfs")).To(BeTrue())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue