Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
02099f44
Unverified
Commit
02099f44
authored
Aug 28, 2018
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the minwidth of the cli table printer
For a few columns we want to have a smaller width and 10 is excessive.
parent
2548fb08
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
get_contexts_test.go
pkg/kubectl/cmd/config/get_contexts_test.go
+1
-1
get_test.go
pkg/kubectl/cmd/get/get_test.go
+20
-20
customcolumn_test.go
pkg/printers/customcolumn_test.go
+0
-0
tabwriter.go
pkg/printers/tabwriter.go
+1
-1
No files found.
pkg/kubectl/cmd/config/get_contexts_test.go
View file @
02099f44
...
@@ -171,7 +171,7 @@ func (test getContextsTest) run(t *testing.T) {
...
@@ -171,7 +171,7 @@ func (test getContextsTest) run(t *testing.T) {
cmd
.
Run
(
cmd
,
test
.
names
)
cmd
.
Run
(
cmd
,
test
.
names
)
if
len
(
test
.
expectedOut
)
!=
0
{
if
len
(
test
.
expectedOut
)
!=
0
{
if
buf
.
String
()
!=
test
.
expectedOut
{
if
buf
.
String
()
!=
test
.
expectedOut
{
t
.
Errorf
(
"Expected
%v, but got %v
"
,
test
.
expectedOut
,
buf
.
String
())
t
.
Errorf
(
"Expected
\n
%s
\n
got
\n
%s
"
,
test
.
expectedOut
,
buf
.
String
())
}
}
return
return
}
}
...
...
pkg/kubectl/cmd/get/get_test.go
View file @
02099f44
...
@@ -264,7 +264,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
...
@@ -264,7 +264,7 @@ func TestGetObjectsWithOpenAPIOutputFormatPresent(t *testing.T) {
foo 10
foo 10
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -316,7 +316,7 @@ func TestGetObjects(t *testing.T) {
...
@@ -316,7 +316,7 @@ func TestGetObjects(t *testing.T) {
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -342,7 +342,7 @@ func TestGetObjectsShowKind(t *testing.T) {
...
@@ -342,7 +342,7 @@ func TestGetObjectsShowKind(t *testing.T) {
pod/foo 0/0 0 <unknown>
pod/foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -401,7 +401,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
@@ -401,7 +401,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown>
service/baz ClusterIP <none> <none> <none> <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -427,7 +427,7 @@ func TestGetObjectsShowLabels(t *testing.T) {
...
@@ -427,7 +427,7 @@ func TestGetObjectsShowLabels(t *testing.T) {
foo 0/0 0 <unknown> <none>
foo 0/0 0 <unknown> <none>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -522,7 +522,7 @@ b 0/0 0 <unknown>
...
@@ -522,7 +522,7 @@ b 0/0 0 <unknown>
c 0/0 0 <unknown>
c 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -548,7 +548,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
...
@@ -548,7 +548,7 @@ func TestGetObjectsIdentifiedByFile(t *testing.T) {
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -574,7 +574,7 @@ foo 0/0 0 <unknown>
...
@@ -574,7 +574,7 @@ foo 0/0 0 <unknown>
bar 0/0 0 <unknown>
bar 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -601,7 +601,7 @@ serverbad Unhealthy bad status: 500
...
@@ -601,7 +601,7 @@ serverbad Unhealthy bad status: 500
serverunknown Unhealthy fizzbuzz error
serverunknown Unhealthy fizzbuzz error
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -663,7 +663,7 @@ func TestGetMixedGenericObjects(t *testing.T) {
...
@@ -663,7 +663,7 @@ func TestGetMixedGenericObjects(t *testing.T) {
}
}
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -701,7 +701,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
@@ -701,7 +701,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown>
service/baz ClusterIP <none> <none> <none> <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -843,7 +843,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
@@ -843,7 +843,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown>
service/baz ClusterIP <none> <none> <none> <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -886,7 +886,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
@@ -886,7 +886,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/baz ClusterIP <none> <none> <none> <unknown>
service/baz ClusterIP <none> <none> <none> <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -929,7 +929,7 @@ NAME STATUS ROLES AGE VERSION
...
@@ -929,7 +929,7 @@ NAME STATUS ROLES AGE VERSION
node/foo Unknown <none> <unknown>
node/foo Unknown <none> <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1050,7 +1050,7 @@ foo 0/0 0 <unknown>
...
@@ -1050,7 +1050,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1101,7 +1101,7 @@ foo 0/0 0 <unknown>
...
@@ -1101,7 +1101,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1144,7 +1144,7 @@ foo 0/0 0 <unknown>
...
@@ -1144,7 +1144,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1188,7 +1188,7 @@ foo 0/0 0 <unknown>
...
@@ -1188,7 +1188,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1230,7 +1230,7 @@ foo 0/0 0 <unknown>
...
@@ -1230,7 +1230,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
@@ -1275,7 +1275,7 @@ foo 0/0 0 <unknown>
...
@@ -1275,7 +1275,7 @@ foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
foo 0/0 0 <unknown>
`
`
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
if
e
,
a
:=
expected
,
buf
.
String
();
e
!=
a
{
t
.
Errorf
(
"expected
%v, got
%v"
,
e
,
a
)
t
.
Errorf
(
"expected
\n
%v
\n
got
\n
%v"
,
e
,
a
)
}
}
}
}
...
...
pkg/printers/customcolumn_test.go
View file @
02099f44
pkg/printers/tabwriter.go
View file @
02099f44
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
)
)
const
(
const
(
tabwriterMinWidth
=
10
tabwriterMinWidth
=
6
tabwriterWidth
=
4
tabwriterWidth
=
4
tabwriterPadding
=
3
tabwriterPadding
=
3
tabwriterPadChar
=
' '
tabwriterPadChar
=
' '
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment