Unverified Commit 74bcefc8 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64063 from roycaihw/support-get-status

Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiservices/status and certificatesigningrequests/status support get+update+patch **What this PR does / why we need it**: Fix the remaining `/status` subresources that return 405 on GET and PATCH **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref https://github.com/kubernetes/kubernetes/pull/63619 **Release note**: ```release-note apiservices/status and certificatesigningrequests/status now support GET and PATCH ```
parents 0a22c159 4e114fd6
...@@ -20984,6 +20984,41 @@ ...@@ -20984,6 +20984,41 @@
] ]
}, },
"/apis/apiregistration.k8s.io/v1/apiservices/{name}/status": { "/apis/apiregistration.k8s.io/v1/apiservices/{name}/status": {
"get": {
"description": "read status of the specified APIService",
"consumes": [
"*/*"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"apiregistration_v1"
],
"operationId": "readApiregistrationV1APIServiceStatus",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIService"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "get",
"x-kubernetes-group-version-kind": {
"group": "apiregistration.k8s.io",
"kind": "APIService",
"version": "v1"
}
},
"put": { "put": {
"description": "replace status of the specified APIService", "description": "replace status of the specified APIService",
"consumes": [ "consumes": [
...@@ -21035,6 +21070,53 @@ ...@@ -21035,6 +21070,53 @@
"version": "v1" "version": "v1"
} }
}, },
"patch": {
"description": "partially update status of the specified APIService",
"consumes": [
"application/json-patch+json",
"application/merge-patch+json",
"application/strategic-merge-patch+json"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"apiregistration_v1"
],
"operationId": "patchApiregistrationV1APIServiceStatus",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIService"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "patch",
"x-kubernetes-group-version-kind": {
"group": "apiregistration.k8s.io",
"kind": "APIService",
"version": "v1"
}
},
"parameters": [ "parameters": [
{ {
"uniqueItems": true, "uniqueItems": true,
...@@ -21793,6 +21875,41 @@ ...@@ -21793,6 +21875,41 @@
] ]
}, },
"/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status": { "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status": {
"get": {
"description": "read status of the specified APIService",
"consumes": [
"*/*"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"apiregistration_v1beta1"
],
"operationId": "readApiregistrationV1beta1APIServiceStatus",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIService"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "get",
"x-kubernetes-group-version-kind": {
"group": "apiregistration.k8s.io",
"kind": "APIService",
"version": "v1beta1"
}
},
"put": { "put": {
"description": "replace status of the specified APIService", "description": "replace status of the specified APIService",
"consumes": [ "consumes": [
...@@ -21844,6 +21961,53 @@ ...@@ -21844,6 +21961,53 @@
"version": "v1beta1" "version": "v1beta1"
} }
}, },
"patch": {
"description": "partially update status of the specified APIService",
"consumes": [
"application/json-patch+json",
"application/merge-patch+json",
"application/strategic-merge-patch+json"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"apiregistration_v1beta1"
],
"operationId": "patchApiregistrationV1beta1APIServiceStatus",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIService"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "patch",
"x-kubernetes-group-version-kind": {
"group": "apiregistration.k8s.io",
"kind": "APIService",
"version": "v1beta1"
}
},
"parameters": [ "parameters": [
{ {
"uniqueItems": true, "uniqueItems": true,
...@@ -44754,6 +44918,41 @@ ...@@ -44754,6 +44918,41 @@
] ]
}, },
"/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status": { "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status": {
"get": {
"description": "read status of the specified CertificateSigningRequest",
"consumes": [
"*/*"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"certificates_v1beta1"
],
"operationId": "readCertificatesV1beta1CertificateSigningRequestStatus",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.certificates.v1beta1.CertificateSigningRequest"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "get",
"x-kubernetes-group-version-kind": {
"group": "certificates.k8s.io",
"kind": "CertificateSigningRequest",
"version": "v1beta1"
}
},
"put": { "put": {
"description": "replace status of the specified CertificateSigningRequest", "description": "replace status of the specified CertificateSigningRequest",
"consumes": [ "consumes": [
...@@ -44805,6 +45004,53 @@ ...@@ -44805,6 +45004,53 @@
"version": "v1beta1" "version": "v1beta1"
} }
}, },
"patch": {
"description": "partially update status of the specified CertificateSigningRequest",
"consumes": [
"application/json-patch+json",
"application/merge-patch+json",
"application/strategic-merge-patch+json"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"tags": [
"certificates_v1beta1"
],
"operationId": "patchCertificatesV1beta1CertificateSigningRequestStatus",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/io.k8s.api.certificates.v1beta1.CertificateSigningRequest"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "patch",
"x-kubernetes-group-version-kind": {
"group": "certificates.k8s.io",
"kind": "CertificateSigningRequest",
"version": "v1beta1"
}
},
"parameters": [ "parameters": [
{ {
"uniqueItems": true, "uniqueItems": true,
...@@ -766,6 +766,45 @@ ...@@ -766,6 +766,45 @@
"operations": [ "operations": [
{ {
"type": "v1beta1.CertificateSigningRequest", "type": "v1beta1.CertificateSigningRequest",
"method": "GET",
"summary": "read status of the specified CertificateSigningRequest",
"nickname": "readCertificateSigningRequestStatus",
"parameters": [
{
"type": "string",
"paramType": "query",
"name": "pretty",
"description": "If 'true', then the output is pretty printed.",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
"name": "name",
"description": "name of the CertificateSigningRequest",
"required": true,
"allowMultiple": false
}
],
"responseMessages": [
{
"code": 200,
"message": "OK",
"responseModel": "v1beta1.CertificateSigningRequest"
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"consumes": [
"*/*"
]
},
{
"type": "v1beta1.CertificateSigningRequest",
"method": "PUT", "method": "PUT",
"summary": "replace status of the specified CertificateSigningRequest", "summary": "replace status of the specified CertificateSigningRequest",
"nickname": "replaceCertificateSigningRequestStatus", "nickname": "replaceCertificateSigningRequestStatus",
...@@ -815,6 +854,55 @@ ...@@ -815,6 +854,55 @@
"consumes": [ "consumes": [
"*/*" "*/*"
] ]
},
{
"type": "v1beta1.CertificateSigningRequest",
"method": "PATCH",
"summary": "partially update status of the specified CertificateSigningRequest",
"nickname": "patchCertificateSigningRequestStatus",
"parameters": [
{
"type": "string",
"paramType": "query",
"name": "pretty",
"description": "If 'true', then the output is pretty printed.",
"required": false,
"allowMultiple": false
},
{
"type": "v1.Patch",
"paramType": "body",
"name": "body",
"description": "",
"required": true,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
"name": "name",
"description": "name of the CertificateSigningRequest",
"required": true,
"allowMultiple": false
}
],
"responseMessages": [
{
"code": 200,
"message": "OK",
"responseModel": "v1beta1.CertificateSigningRequest"
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"consumes": [
"application/json-patch+json",
"application/merge-patch+json",
"application/strategic-merge-patch+json"
]
} }
] ]
}, },
......
...@@ -15,6 +15,7 @@ go_library( ...@@ -15,6 +15,7 @@ go_library(
"//pkg/printers/internalversion:go_default_library", "//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage:go_default_library", "//pkg/printers/storage:go_default_library",
"//pkg/registry/certificates/certificates:go_default_library", "//pkg/registry/certificates/certificates:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",
......
...@@ -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
......
...@@ -10,6 +10,7 @@ go_library( ...@@ -10,6 +10,7 @@ go_library(
srcs = ["etcd.go"], srcs = ["etcd.go"],
importpath = "k8s.io/kube-aggregator/pkg/registry/apiservice/etcd", importpath = "k8s.io/kube-aggregator/pkg/registry/apiservice/etcd",
deps = [ deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",
......
...@@ -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.Updater(&StatusREST{}) var _ = rest.Patcher(&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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment