Unverified Commit 10b1b838 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #67965 from smarterclayton/slim_output

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Reduce the minwidth of the cli table printer For a few columns we want to have a smaller width and 10 is excessive. The example is CPU and memory for nodes.
parents d293eba9 02099f44
......@@ -61,7 +61,7 @@ func TestGetContextsAllNoHeader(t *testing.T) {
names: []string{},
noHeader: true,
nameOnly: false,
expectedOut: "* shaker-context big-cluster blue-user saw-ns\n",
expectedOut: "* shaker-context big-cluster blue-user saw-ns\n",
}
test.run(t)
}
......@@ -171,7 +171,7 @@ func (test getContextsTest) run(t *testing.T) {
cmd.Run(cmd, test.names)
if len(test.expectedOut) != 0 {
if buf.String() != test.expectedOut {
t.Errorf("Expected %v, but got %v", test.expectedOut, buf.String())
t.Errorf("Expected\n%s\ngot\n%s", test.expectedOut, buf.String())
}
return
}
......
......@@ -286,8 +286,8 @@ bar
},
},
obj: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, TypeMeta: metav1.TypeMeta{APIVersion: "baz"}},
expectedOutput: `NAME API_VERSION
foo baz
expectedOutput: `NAME API_VERSION
foo baz
`,
},
{
......@@ -306,8 +306,8 @@ foo baz
},
},
obj: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, TypeMeta: metav1.TypeMeta{APIVersion: "baz"}},
expectedOutput: `NAME API_VERSION NOT_FOUND
foo baz <none>
expectedOutput: `NAME API_VERSION NOT_FOUND
foo baz <none>
`,
},
}
......@@ -349,9 +349,9 @@ func TestIndividualPrintObjOnExistingTabWriter(t *testing.T) {
{ObjectMeta: metav1.ObjectMeta{Name: "foo", Labels: map[string]string{"label1": "foo", "label2": "foo"}}},
{ObjectMeta: metav1.ObjectMeta{Name: "bar", Labels: map[string]string{"label1": "bar", "label2": "bar"}}},
}
expectedOutput := `NAME LONG COLUMN NAME LABEL 2
foo foo foo
bar bar bar
expectedOutput := `NAME LONG COLUMN NAME LABEL 2
foo foo foo
bar bar bar
`
buffer := &bytes.Buffer{}
......
......@@ -22,7 +22,7 @@ import (
)
const (
tabwriterMinWidth = 10
tabwriterMinWidth = 6
tabwriterWidth = 4
tabwriterPadding = 3
tabwriterPadChar = ' '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment