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
cd13c41d
Commit
cd13c41d
authored
May 18, 2018
by
Haowei Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GET PATCH support for two /status:
apiservices/status under apiregistration.k8s.io certificatesigningrequests/status under certificates.k8s.io
parent
1e689a8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
storage.go
pkg/registry/certificates/certificates/storage/storage.go
+8
-0
etcd.go
...s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
+7
-1
No files found.
pkg/registry/certificates/certificates/storage/storage.go
View file @
cd13c41d
...
@@ -19,6 +19,7 @@ package storage
...
@@ -19,6 +19,7 @@ package storage
import
(
import
(
"context"
"context"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic"
genericregistry
"k8s.io/apiserver/pkg/registry/generic/registry"
genericregistry
"k8s.io/apiserver/pkg/registry/generic/registry"
...
@@ -83,11 +84,18 @@ func (r *StatusREST) New() runtime.Object {
...
@@ -83,11 +84,18 @@ func (r *StatusREST) New() runtime.Object {
return
&
certificates
.
CertificateSigningRequest
{}
return
&
certificates
.
CertificateSigningRequest
{}
}
}
// Get retrieves the object from the storage. It is required to support Patch.
func
(
r
*
StatusREST
)
Get
(
ctx
context
.
Context
,
name
string
,
options
*
metav1
.
GetOptions
)
(
runtime
.
Object
,
error
)
{
return
r
.
store
.
Get
(
ctx
,
name
,
options
)
}
// Update alters the status subset of an object.
// Update alters the status subset of an object.
func
(
r
*
StatusREST
)
Update
(
ctx
context
.
Context
,
name
string
,
objInfo
rest
.
UpdatedObjectInfo
,
createValidation
rest
.
ValidateObjectFunc
,
updateValidation
rest
.
ValidateObjectUpdateFunc
)
(
runtime
.
Object
,
bool
,
error
)
{
func
(
r
*
StatusREST
)
Update
(
ctx
context
.
Context
,
name
string
,
objInfo
rest
.
UpdatedObjectInfo
,
createValidation
rest
.
ValidateObjectFunc
,
updateValidation
rest
.
ValidateObjectUpdateFunc
)
(
runtime
.
Object
,
bool
,
error
)
{
return
r
.
store
.
Update
(
ctx
,
name
,
objInfo
,
createValidation
,
updateValidation
)
return
r
.
store
.
Update
(
ctx
,
name
,
objInfo
,
createValidation
,
updateValidation
)
}
}
var
_
=
rest
.
Patcher
(
&
StatusREST
{})
// ApprovalREST implements the REST endpoint for changing the approval state of a CSR.
// ApprovalREST implements the REST endpoint for changing the approval state of a CSR.
type
ApprovalREST
struct
{
type
ApprovalREST
struct
{
store
*
genericregistry
.
Store
store
*
genericregistry
.
Store
...
...
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
View file @
cd13c41d
...
@@ -19,6 +19,7 @@ package etcd
...
@@ -19,6 +19,7 @@ package etcd
import
(
import
(
"context"
"context"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic"
genericregistry
"k8s.io/apiserver/pkg/registry/generic/registry"
genericregistry
"k8s.io/apiserver/pkg/registry/generic/registry"
...
@@ -66,12 +67,17 @@ type StatusREST struct {
...
@@ -66,12 +67,17 @@ type StatusREST struct {
store
*
genericregistry
.
Store
store
*
genericregistry
.
Store
}
}
var
_
=
rest
.
Updat
er
(
&
StatusREST
{})
var
_
=
rest
.
Patch
er
(
&
StatusREST
{})
func
(
r
*
StatusREST
)
New
()
runtime
.
Object
{
func
(
r
*
StatusREST
)
New
()
runtime
.
Object
{
return
&
apiregistration
.
APIService
{}
return
&
apiregistration
.
APIService
{}
}
}
// Get retrieves the object from the storage. It is required to support Patch.
func
(
r
*
StatusREST
)
Get
(
ctx
context
.
Context
,
name
string
,
options
*
metav1
.
GetOptions
)
(
runtime
.
Object
,
error
)
{
return
r
.
store
.
Get
(
ctx
,
name
,
options
)
}
// Update alters the status subset of an object.
// Update alters the status subset of an object.
func
(
r
*
StatusREST
)
Update
(
ctx
context
.
Context
,
name
string
,
objInfo
rest
.
UpdatedObjectInfo
,
createValidation
rest
.
ValidateObjectFunc
,
updateValidation
rest
.
ValidateObjectUpdateFunc
)
(
runtime
.
Object
,
bool
,
error
)
{
func
(
r
*
StatusREST
)
Update
(
ctx
context
.
Context
,
name
string
,
objInfo
rest
.
UpdatedObjectInfo
,
createValidation
rest
.
ValidateObjectFunc
,
updateValidation
rest
.
ValidateObjectUpdateFunc
)
(
runtime
.
Object
,
bool
,
error
)
{
return
r
.
store
.
Update
(
ctx
,
name
,
objInfo
,
createValidation
,
updateValidation
)
return
r
.
store
.
Update
(
ctx
,
name
,
objInfo
,
createValidation
,
updateValidation
)
...
...
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