Revert docker volume column name to VOLUME_NAME

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-10-17 20:03:31 +02:00
parent 6566662d1b
commit 6c3c3a87ba
2 changed files with 6 additions and 5 deletions

View File

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

View File

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