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
0a1b76cb
Unverified
Commit
0a1b76cb
authored
Jan 15, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit all category to apps group for ds/deployment/replicaset
parent
e2907417
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
11 deletions
+33
-11
test-cmd-util.sh
hack/make-rules/test-cmd-util.sh
+6
-2
storage.go
pkg/registry/extensions/daemonset/storage/storage.go
+8
-2
storage.go
pkg/registry/extensions/deployment/storage/storage.go
+8
-2
storage.go
pkg/registry/extensions/replicaset/storage/storage.go
+8
-2
storage_extensions.go
pkg/registry/extensions/rest/storage_extensions.go
+3
-3
No files found.
hack/make-rules/test-cmd-util.sh
View file @
0a1b76cb
...
@@ -1397,11 +1397,15 @@ run_kubectl_get_tests() {
...
@@ -1397,11 +1397,15 @@ run_kubectl_get_tests() {
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/pods 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/pods 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/replicationcontrollers 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/replicationcontrollers 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/services 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/api/v1/namespaces/default/services 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/apps/v1/namespaces/default/daemonsets 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/apps/v1/namespaces/default/deployments 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/apps/v1/namespaces/default/replicasets 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/apps/v1/namespaces/default/statefulsets 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/apps/v1/namespaces/default/statefulsets 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/autoscaling/v1/namespaces/default/horizontalpodautoscalers 200"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/autoscaling/v1/namespaces/default/horizontalpodautoscalers 200"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/batch/v1/namespaces/default/jobs 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/batch/v1/namespaces/default/jobs 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/extensions/v1beta1/namespaces/default/deployments 200 OK"
kube::test::if_has_not_string
"
${
output_message
}
"
"/apis/extensions/v1beta1/namespaces/default/daemonsets 200 OK"
kube::test::if_has_string
"
${
output_message
}
"
"/apis/extensions/v1beta1/namespaces/default/replicasets 200 OK"
kube::test::if_has_not_string
"
${
output_message
}
"
"/apis/extensions/v1beta1/namespaces/default/deployments 200 OK"
kube::test::if_has_not_string
"
${
output_message
}
"
"/apis/extensions/v1beta1/namespaces/default/replicasets 200 OK"
### Test kubectl get chunk size
### Test kubectl get chunk size
output_message
=
$(
kubectl
--v
=
6 get clusterrole
--chunk-size
=
10 2>&1
"
${
kube_flags
[@]
}
"
)
output_message
=
$(
kubectl
--v
=
6 get clusterrole
--chunk-size
=
10 2>&1
"
${
kube_flags
[@]
}
"
)
...
...
pkg/registry/extensions/daemonset/storage/storage.go
View file @
0a1b76cb
...
@@ -33,6 +33,7 @@ import (
...
@@ -33,6 +33,7 @@ import (
// rest implements a RESTStorage for DaemonSets
// rest implements a RESTStorage for DaemonSets
type
REST
struct
{
type
REST
struct
{
*
genericregistry
.
Store
*
genericregistry
.
Store
categories
[]
string
}
}
// NewREST returns a RESTStorage object that will work against DaemonSets.
// NewREST returns a RESTStorage object that will work against DaemonSets.
...
@@ -56,7 +57,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
...
@@ -56,7 +57,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
statusStore
:=
*
store
statusStore
:=
*
store
statusStore
.
UpdateStrategy
=
daemonset
.
StatusStrategy
statusStore
.
UpdateStrategy
=
daemonset
.
StatusStrategy
return
&
REST
{
store
},
&
StatusREST
{
store
:
&
statusStore
}
return
&
REST
{
store
,
[]
string
{
"all"
}
},
&
StatusREST
{
store
:
&
statusStore
}
}
}
// Implement ShortNamesProvider
// Implement ShortNamesProvider
...
@@ -71,7 +72,12 @@ var _ rest.CategoriesProvider = &REST{}
...
@@ -71,7 +72,12 @@ var _ rest.CategoriesProvider = &REST{}
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
func
(
r
*
REST
)
Categories
()
[]
string
{
func
(
r
*
REST
)
Categories
()
[]
string
{
return
[]
string
{
"all"
}
return
r
.
categories
}
func
(
r
*
REST
)
WithCategories
(
categories
[]
string
)
*
REST
{
r
.
categories
=
categories
return
r
}
}
// StatusREST implements the REST endpoint for changing the status of a daemonset
// StatusREST implements the REST endpoint for changing the status of a daemonset
...
...
pkg/registry/extensions/deployment/storage/storage.go
View file @
0a1b76cb
...
@@ -63,6 +63,7 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) DeploymentStorage {
...
@@ -63,6 +63,7 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) DeploymentStorage {
type
REST
struct
{
type
REST
struct
{
*
genericregistry
.
Store
*
genericregistry
.
Store
categories
[]
string
}
}
// NewREST returns a RESTStorage object that will work against deployments.
// NewREST returns a RESTStorage object that will work against deployments.
...
@@ -83,7 +84,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *Rollbac
...
@@ -83,7 +84,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *Rollbac
statusStore
:=
*
store
statusStore
:=
*
store
statusStore
.
UpdateStrategy
=
deployment
.
StatusStrategy
statusStore
.
UpdateStrategy
=
deployment
.
StatusStrategy
return
&
REST
{
store
},
&
StatusREST
{
store
:
&
statusStore
},
&
RollbackREST
{
store
:
store
}
return
&
REST
{
store
,
[]
string
{
"all"
}
},
&
StatusREST
{
store
:
&
statusStore
},
&
RollbackREST
{
store
:
store
}
}
}
// Implement ShortNamesProvider
// Implement ShortNamesProvider
...
@@ -99,7 +100,12 @@ var _ rest.CategoriesProvider = &REST{}
...
@@ -99,7 +100,12 @@ var _ rest.CategoriesProvider = &REST{}
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
func
(
r
*
REST
)
Categories
()
[]
string
{
func
(
r
*
REST
)
Categories
()
[]
string
{
return
[]
string
{
"all"
}
return
r
.
categories
}
func
(
r
*
REST
)
WithCategories
(
categories
[]
string
)
*
REST
{
r
.
categories
=
categories
return
r
}
}
// StatusREST implements the REST endpoint for changing the status of a deployment
// StatusREST implements the REST endpoint for changing the status of a deployment
...
...
pkg/registry/extensions/replicaset/storage/storage.go
View file @
0a1b76cb
...
@@ -62,6 +62,7 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) ReplicaSetStorage {
...
@@ -62,6 +62,7 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) ReplicaSetStorage {
type
REST
struct
{
type
REST
struct
{
*
genericregistry
.
Store
*
genericregistry
.
Store
categories
[]
string
}
}
// NewREST returns a RESTStorage object that will work against ReplicaSet.
// NewREST returns a RESTStorage object that will work against ReplicaSet.
...
@@ -86,7 +87,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
...
@@ -86,7 +87,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
statusStore
:=
*
store
statusStore
:=
*
store
statusStore
.
UpdateStrategy
=
replicaset
.
StatusStrategy
statusStore
.
UpdateStrategy
=
replicaset
.
StatusStrategy
return
&
REST
{
store
},
&
StatusREST
{
store
:
&
statusStore
}
return
&
REST
{
store
,
[]
string
{
"all"
}
},
&
StatusREST
{
store
:
&
statusStore
}
}
}
// Implement ShortNamesProvider
// Implement ShortNamesProvider
...
@@ -102,7 +103,12 @@ var _ rest.CategoriesProvider = &REST{}
...
@@ -102,7 +103,12 @@ var _ rest.CategoriesProvider = &REST{}
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
func
(
r
*
REST
)
Categories
()
[]
string
{
func
(
r
*
REST
)
Categories
()
[]
string
{
return
[]
string
{
"all"
}
return
r
.
categories
}
func
(
r
*
REST
)
WithCategories
(
categories
[]
string
)
*
REST
{
r
.
categories
=
categories
return
r
}
}
// StatusREST implements the REST endpoint for changing the status of a ReplicaSet
// StatusREST implements the REST endpoint for changing the status of a ReplicaSet
...
...
pkg/registry/extensions/rest/storage_extensions.go
View file @
0a1b76cb
...
@@ -62,12 +62,12 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
...
@@ -62,12 +62,12 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"daemonsets"
))
{
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"daemonsets"
))
{
daemonSetStorage
,
daemonSetStatusStorage
:=
daemonstore
.
NewREST
(
restOptionsGetter
)
daemonSetStorage
,
daemonSetStatusStorage
:=
daemonstore
.
NewREST
(
restOptionsGetter
)
storage
[
"daemonsets"
]
=
daemonSetStorage
storage
[
"daemonsets"
]
=
daemonSetStorage
.
WithCategories
(
nil
)
storage
[
"daemonsets/status"
]
=
daemonSetStatusStorage
storage
[
"daemonsets/status"
]
=
daemonSetStatusStorage
}
}
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"deployments"
))
{
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"deployments"
))
{
deploymentStorage
:=
deploymentstore
.
NewStorage
(
restOptionsGetter
)
deploymentStorage
:=
deploymentstore
.
NewStorage
(
restOptionsGetter
)
storage
[
"deployments"
]
=
deploymentStorage
.
Deployment
storage
[
"deployments"
]
=
deploymentStorage
.
Deployment
.
WithCategories
(
nil
)
storage
[
"deployments/status"
]
=
deploymentStorage
.
Status
storage
[
"deployments/status"
]
=
deploymentStorage
.
Status
storage
[
"deployments/rollback"
]
=
deploymentStorage
.
Rollback
storage
[
"deployments/rollback"
]
=
deploymentStorage
.
Rollback
storage
[
"deployments/scale"
]
=
deploymentStorage
.
Scale
storage
[
"deployments/scale"
]
=
deploymentStorage
.
Scale
...
@@ -83,7 +83,7 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
...
@@ -83,7 +83,7 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
}
}
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"replicasets"
))
{
if
apiResourceConfigSource
.
ResourceEnabled
(
version
.
WithResource
(
"replicasets"
))
{
replicaSetStorage
:=
replicasetstore
.
NewStorage
(
restOptionsGetter
)
replicaSetStorage
:=
replicasetstore
.
NewStorage
(
restOptionsGetter
)
storage
[
"replicasets"
]
=
replicaSetStorage
.
ReplicaSet
storage
[
"replicasets"
]
=
replicaSetStorage
.
ReplicaSet
.
WithCategories
(
nil
)
storage
[
"replicasets/status"
]
=
replicaSetStorage
.
Status
storage
[
"replicasets/status"
]
=
replicaSetStorage
.
Status
storage
[
"replicasets/scale"
]
=
replicaSetStorage
.
Scale
storage
[
"replicasets/scale"
]
=
replicaSetStorage
.
Scale
}
}
...
...
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