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
613b302b
Unverified
Commit
613b302b
authored
Jun 28, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug printing openapi columns
parent
44073e6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
test-cmd-util.sh
hack/make-rules/test-cmd-util.sh
+6
-0
get.go
pkg/kubectl/cmd/get/get.go
+4
-0
No files found.
hack/make-rules/test-cmd-util.sh
View file @
613b302b
...
...
@@ -1392,6 +1392,12 @@ run_kubectl_old_print_tests() {
actual_output
=
$(
kubectl get pod
--server-print
=
false
"
${
kube_flags
[@]
}
"
|
awk
'NF{NF--};1'
)
kube::test::if_has_string
"
${
actual_output
}
"
"
${
expected_output
}
"
# Test printing objects with --use-openapi-print-columns
actual_output
=
$(
kubectl get namespaces
--use-openapi-print-columns
--v
=
7
"
${
kube_flags
[@]
}
"
2>&1
)
# it should request full objects (not server-side printing)
kube::test::if_has_not_string
"
${
actual_output
}
"
'application/json;as=Table'
kube::test::if_has_string
"
${
actual_output
}
"
'application/json'
### Test retrieval of daemonsets against server-side printing
kubectl apply
-f
hack/testdata/rollingupdate-daemonset.yaml
"
${
kube_flags
[@]
}
"
# Post-condition: daemonset is created
...
...
pkg/kubectl/cmd/get/get.go
View file @
613b302b
...
...
@@ -318,6 +318,10 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e
Latest
()
.
Flatten
()
.
TransformRequests
(
func
(
req
*
rest
.
Request
)
{
// We need full objects if printing with openapi columns
if
o
.
PrintWithOpenAPICols
{
return
}
if
o
.
ServerPrint
&&
o
.
IsHumanReadablePrinter
&&
!
o
.
Sort
{
group
:=
metav1beta1
.
GroupName
version
:=
metav1beta1
.
SchemeGroupVersion
.
Version
...
...
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