Merge pull request #27457 from vdemeester/use-volume-name

Revert docker volume column name to VOLUME_NAME
This commit is contained in:
Sebastiaan van Stijn 2016-10-17 13:00:50 -07:00 committed by GitHub
commit 81ce55bb87
2 changed files with 6 additions and 5 deletions

View file

@ -12,6 +12,7 @@ const (
defaultVolumeQuietFormat = "{{.Name}}"
defaultVolumeTableFormat = "table {{.Driver}}\t{{.Name}}"
volumeNameHeader = "VOLUME NAME"
mountpointHeader = "MOUNTPOINT"
linksHeader = "LINKS"
// Status header ?
@ -53,7 +54,7 @@ type volumeContext struct {
}
func (c *volumeContext) Name() string {
c.AddHeader(nameHeader)
c.AddHeader(volumeNameHeader)
return c.v.Name
}

View file

@ -22,7 +22,7 @@ func TestVolumeContext(t *testing.T) {
}{
{volumeContext{
v: types.Volume{Name: volumeName},
}, volumeName, nameHeader, ctx.Name},
}, volumeName, volumeNameHeader, ctx.Name},
{volumeContext{
v: types.Volume{Driver: "driver_name"},
}, "driver_name", driverHeader, ctx.Driver},
@ -76,7 +76,7 @@ func TestVolumeContextWrite(t *testing.T) {
// Table format
{
Context{Format: NewVolumeFormat("table", false)},
`DRIVER NAME
`DRIVER VOLUME NAME
foo foobar_baz
bar foobar_bar
`,
@ -89,14 +89,14 @@ foobar_bar
},
{
Context{Format: NewVolumeFormat("table {{.Name}}", false)},
`NAME
`VOLUME NAME
foobar_baz
foobar_bar
`,
},
{
Context{Format: NewVolumeFormat("table {{.Name}}", true)},
`NAME
`VOLUME NAME
foobar_baz
foobar_bar
`,