From 6c3c3a87ba4b3e80aeca4faa64a6eed057395c06 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 17 Oct 2016 20:03:31 +0200 Subject: [PATCH] Revert docker volume column name to VOLUME_NAME Signed-off-by: Vincent Demeester --- command/formatter/volume.go | 3 ++- command/formatter/volume_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/command/formatter/volume.go b/command/formatter/volume.go index 7bc3537573..695885b2fa 100644 --- a/command/formatter/volume.go +++ b/command/formatter/volume.go @@ -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 } diff --git a/command/formatter/volume_test.go b/command/formatter/volume_test.go index 8c715b3438..8b92e8e164 100644 --- a/command/formatter/volume_test.go +++ b/command/formatter/volume_test.go @@ -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 `,