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
```
pull/8/head
Kubernetes Submit Queue 2018-05-23 18:14:20 -07:00 committed by GitHub
commit 74bcefc8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 602 additions and 16 deletions

View File

@ -20984,6 +20984,41 @@
]
},
"/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": {
"description": "replace status of the specified APIService",
"consumes": [
@ -21035,6 +21070,53 @@
"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": [
{
"uniqueItems": true,
@ -21793,6 +21875,41 @@
]
},
"/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": {
"description": "replace status of the specified APIService",
"consumes": [
@ -21844,6 +21961,53 @@
"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": [
{
"uniqueItems": true,
@ -44754,6 +44918,41 @@
]
},
"/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": {
"description": "replace status of the specified CertificateSigningRequest",
"consumes": [
@ -44805,6 +45004,53 @@
"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": [
{
"uniqueItems": true,

View File

@ -764,6 +764,45 @@
"path": "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status",
"description": "API at /apis/certificates.k8s.io/v1beta1",
"operations": [
{
"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",
@ -815,6 +854,55 @@
"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"
]
}
]
},

View File

@ -1549,6 +1549,117 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect2">
<h3 id="_read_status_of_the_specified_certificatesigningrequest">read status of the specified CertificateSigningRequest</h3>
<div class="listingblock">
<div class="content">
<pre>GET /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status</pre>
</div>
</div>
<div class="sect3">
<h4 id="_parameters_9">Parameters</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">pretty</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">If <em>true</em>, then the output is pretty printed.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name of the CertificateSigningRequest</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_responses_10">Responses</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:33%;">
<col style="width:33%;">
<col style="width:33%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">HTTP Code</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Schema</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">200</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">success</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../definitions#_v1beta1_certificatesigningrequest">v1beta1.CertificateSigningRequest</a></p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_consumes_10">Consumes</h4>
<div class="ulist">
<ul>
<li>
<p><strong>/</strong></p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_produces_10">Produces</h4>
<div class="ulist">
<ul>
<li>
<p>application/json</p>
</li>
<li>
<p>application/yaml</p>
</li>
<li>
<p>application/vnd.kubernetes.protobuf</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_tags_10">Tags</h4>
<div class="ulist">
<ul>
<li>
<p>apiscertificates.k8s.iov1beta1</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_replace_status_of_the_specified_certificatesigningrequest">replace status of the specified CertificateSigningRequest</h3>
<div class="listingblock">
<div class="content">
@ -1556,7 +1667,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_parameters_9">Parameters</h4>
<h4 id="_parameters_10">Parameters</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:16%;">
@ -1606,7 +1717,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_responses_10">Responses</h4>
<h4 id="_responses_11">Responses</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:33%;">
@ -1636,7 +1747,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_consumes_10">Consumes</h4>
<h4 id="_consumes_11">Consumes</h4>
<div class="ulist">
<ul>
<li>
@ -1646,7 +1757,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_produces_10">Produces</h4>
<h4 id="_produces_11">Produces</h4>
<div class="ulist">
<ul>
<li>
@ -1662,7 +1773,132 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_tags_10">Tags</h4>
<h4 id="_tags_11">Tags</h4>
<div class="ulist">
<ul>
<li>
<p>apiscertificates.k8s.iov1beta1</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_partially_update_status_of_the_specified_certificatesigningrequest">partially update status of the specified CertificateSigningRequest</h3>
<div class="listingblock">
<div class="content">
<pre>PATCH /apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status</pre>
</div>
</div>
<div class="sect3">
<h4 id="_parameters_11">Parameters</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
<col style="width:16%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">QueryParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">pretty</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">If <em>true</em>, then the output is pretty printed.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">BodyParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">body</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../definitions#_v1_patch">v1.Patch</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">PathParameter</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">name of the CertificateSigningRequest</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_responses_12">Responses</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:33%;">
<col style="width:33%;">
<col style="width:33%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">HTTP Code</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Schema</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">200</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">success</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../definitions#_v1beta1_certificatesigningrequest">v1beta1.CertificateSigningRequest</a></p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_consumes_12">Consumes</h4>
<div class="ulist">
<ul>
<li>
<p>application/json-patch+json</p>
</li>
<li>
<p>application/merge-patch+json</p>
</li>
<li>
<p>application/strategic-merge-patch+json</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_produces_12">Produces</h4>
<div class="ulist">
<ul>
<li>
<p>application/json</p>
</li>
<li>
<p>application/yaml</p>
</li>
<li>
<p>application/vnd.kubernetes.protobuf</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_tags_12">Tags</h4>
<div class="ulist">
<ul>
<li>
@ -1680,7 +1916,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_parameters_10">Parameters</h4>
<h4 id="_parameters_12">Parameters</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:16%;">
@ -1779,7 +2015,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_responses_11">Responses</h4>
<h4 id="_responses_13">Responses</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:33%;">
@ -1804,7 +2040,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_consumes_11">Consumes</h4>
<h4 id="_consumes_13">Consumes</h4>
<div class="ulist">
<ul>
<li>
@ -1814,7 +2050,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_produces_11">Produces</h4>
<h4 id="_produces_13">Produces</h4>
<div class="ulist">
<ul>
<li>
@ -1836,7 +2072,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_tags_11">Tags</h4>
<h4 id="_tags_13">Tags</h4>
<div class="ulist">
<ul>
<li>
@ -1854,7 +2090,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_parameters_11">Parameters</h4>
<h4 id="_parameters_13">Parameters</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:16%;">
@ -1961,7 +2197,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_responses_12">Responses</h4>
<h4 id="_responses_14">Responses</h4>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:33%;">
@ -1986,7 +2222,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div class="sect3">
<h4 id="_consumes_12">Consumes</h4>
<h4 id="_consumes_14">Consumes</h4>
<div class="ulist">
<ul>
<li>
@ -1996,7 +2232,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_produces_12">Produces</h4>
<h4 id="_produces_14">Produces</h4>
<div class="ulist">
<ul>
<li>
@ -2018,7 +2254,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
</div>
<div class="sect3">
<h4 id="_tags_12">Tags</h4>
<h4 id="_tags_14">Tags</h4>
<div class="ulist">
<ul>
<li>

View File

@ -15,6 +15,7 @@ go_library(
"//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage: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/apiserver/pkg/registry/generic:go_default_library",
"//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library",

View File

@ -19,6 +19,7 @@ package storage
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/generic"
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
@ -83,11 +84,18 @@ func (r *StatusREST) New() runtime.Object {
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.
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)
}
var _ = rest.Patcher(&StatusREST{})
// ApprovalREST implements the REST endpoint for changing the approval state of a CSR.
type ApprovalREST struct {
store *genericregistry.Store

View File

@ -10,6 +10,7 @@ go_library(
srcs = ["etcd.go"],
importpath = "k8s.io/kube-aggregator/pkg/registry/apiservice/etcd",
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1: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/registry:go_default_library",

View File

@ -19,6 +19,7 @@ package etcd
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/generic"
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
@ -66,12 +67,17 @@ type StatusREST struct {
store *genericregistry.Store
}
var _ = rest.Updater(&StatusREST{})
var _ = rest.Patcher(&StatusREST{})
func (r *StatusREST) New() runtime.Object {
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.
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)