Skip to content

Commit

Permalink
Show volume options in 'volume inspect'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mheon committed Oct 18, 2019
1 parent e7d5ac0 commit 6456f6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libpod/volume_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (v *Volume) Inspect() (*InspectVolumeData, error) {
}
data.Scope = v.Scope()
data.Options = make(map[string]string)
for k, v := range v.config.Options {
data.Options[k] = v
}
data.UID = v.config.UID
data.GID = v.config.GID
data.ContainerSpecific = v.config.IsCtrSpecific
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/volume_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration

import (
"os"
"strings"

. "github.com/containers/libpod/test/utils"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -74,4 +75,16 @@ var _ = Describe("Podman volume inspect", func() {
Expect(session.OutputToStringArray()[0]).To(Equal(volName1))
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())
})
})

0 comments on commit 6456f6d

Please sign in to comment.