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
e5778f05
Commit
e5778f05
authored
May 08, 2019
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unstructured list interface compatibility, fix kubectl paging
parent
8765fa2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
0 deletions
+22
-0
tablegenerator.go
pkg/printers/tablegenerator.go
+1
-0
tableconvertor.go
.../registry/customresource/tableconvertor/tableconvertor.go
+1
-0
meta.go
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go
+2
-0
unstructured.go
...pimachinery/pkg/apis/meta/v1/unstructured/unstructured.go
+9
-0
table.go
staging/src/k8s.io/apiserver/pkg/registry/rest/table.go
+1
-0
etcd.go
...s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
+1
-0
get.sh
test/cmd/get.sh
+7
-0
No files found.
pkg/printers/tablegenerator.go
View file @
e5778f05
...
...
@@ -112,6 +112,7 @@ func (h *HumanReadablePrinter) GenerateTable(obj runtime.Object, options PrintOp
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
table
.
SelfLink
=
m
.
GetSelfLink
()
table
.
Continue
=
m
.
GetContinue
()
table
.
RemainingItemCount
=
m
.
GetRemainingItemCount
()
}
else
{
if
m
,
err
:=
meta
.
CommonAccessor
(
obj
);
err
==
nil
{
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor.go
View file @
e5778f05
...
...
@@ -87,6 +87,7 @@ func (c *convertor) ConvertToTable(ctx context.Context, obj runtime.Object, tabl
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
table
.
SelfLink
=
m
.
GetSelfLink
()
table
.
Continue
=
m
.
GetContinue
()
table
.
RemainingItemCount
=
m
.
GetRemainingItemCount
()
}
else
{
if
m
,
err
:=
meta
.
CommonAccessor
(
obj
);
err
==
nil
{
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
...
...
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go
View file @
e5778f05
...
...
@@ -107,6 +107,8 @@ type Type interface {
SetKind
(
kind
string
)
}
var
_
ListInterface
=
&
ListMeta
{}
func
(
meta
*
ListMeta
)
GetResourceVersion
()
string
{
return
meta
.
ResourceVersion
}
func
(
meta
*
ListMeta
)
SetResourceVersion
(
version
string
)
{
meta
.
ResourceVersion
=
version
}
func
(
meta
*
ListMeta
)
GetSelfLink
()
string
{
return
meta
.
SelfLink
}
...
...
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go
View file @
e5778f05
...
...
@@ -47,6 +47,7 @@ type Unstructured struct {
var
_
metav1
.
Object
=
&
Unstructured
{}
var
_
runtime
.
Unstructured
=
&
Unstructured
{}
var
_
metav1
.
ListInterface
=
&
Unstructured
{}
func
(
obj
*
Unstructured
)
GetObjectKind
()
schema
.
ObjectKind
{
return
obj
}
...
...
@@ -319,6 +320,14 @@ func (u *Unstructured) SetContinue(c string) {
u
.
setNestedField
(
c
,
"metadata"
,
"continue"
)
}
func
(
u
*
Unstructured
)
GetRemainingItemCount
()
int64
{
return
getNestedInt64
(
u
.
Object
,
"metadata"
,
"remainingItemCount"
)
}
func
(
u
*
Unstructured
)
SetRemainingItemCount
(
c
int64
)
{
u
.
setNestedField
(
c
,
"metadata"
,
"remainingItemCount"
)
}
func
(
u
*
Unstructured
)
GetCreationTimestamp
()
metav1
.
Time
{
var
timestamp
metav1
.
Time
timestamp
.
UnmarshalQueryParameter
(
getNestedString
(
u
.
Object
,
"metadata"
,
"creationTimestamp"
))
...
...
staging/src/k8s.io/apiserver/pkg/registry/rest/table.go
View file @
e5778f05
...
...
@@ -67,6 +67,7 @@ func (c defaultTableConvertor) ConvertToTable(ctx context.Context, object runtim
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
table
.
SelfLink
=
m
.
GetSelfLink
()
table
.
Continue
=
m
.
GetContinue
()
table
.
RemainingItemCount
=
m
.
GetRemainingItemCount
()
}
else
{
if
m
,
err
:=
meta
.
CommonAccessor
(
object
);
err
==
nil
{
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
...
...
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
View file @
e5778f05
...
...
@@ -73,6 +73,7 @@ func (c *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
table
.
SelfLink
=
m
.
GetSelfLink
()
table
.
Continue
=
m
.
GetContinue
()
table
.
RemainingItemCount
=
m
.
GetRemainingItemCount
()
}
else
{
if
m
,
err
:=
meta
.
CommonAccessor
(
obj
);
err
==
nil
{
table
.
ResourceVersion
=
m
.
GetResourceVersion
()
...
...
test/cmd/get.sh
View file @
e5778f05
...
...
@@ -129,6 +129,13 @@ run_kubectl_get_tests() {
# Post-condition: Check if we get a limit and continue
kube::test::if_has_string
"
${
output_message
}
"
"/clusterroles?limit=500 200 OK"
### Test kubectl get accumulates pages
output_message
=
$(
kubectl get namespaces
--chunk-size
=
1
--no-headers
"
${
kube_flags
[@]
}
"
)
# Post-condition: Check we got multiple pages worth of namespaces
kube::test::if_has_string
"
${
output_message
}
"
"default"
kube::test::if_has_string
"
${
output_message
}
"
"kube-public"
kube::test::if_has_string
"
${
output_message
}
"
"kube-system"
### Test kubectl get chunk size does not result in a --watch error when resource list is served in multiple chunks
# Pre-condition: ConfigMap one two tree does not exist
kube::test::get_object_assert
'configmaps'
'{{range.items}}{{ if eq $id_field \"one\" }}found{{end}}{{end}}:'
':'
...
...
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