Commit 9ea94806 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #40312 from p0lyn0mial/add_shortName_to_the_api

Automatic merge from submit-queue Added shortName to meta.v1.APIResource. The shortNames would be used to allow kubectl to have short names representations of resources from aggregated API servers. ```release-note Adds `shortNames` to the `APIResource` from discovery which is a list of recommended shortNames for clients like `kubectl`. ``` **What this PR does / why we need it**: The shortNames would be used to allow kubectl to have short names representations of resources from aggregated API servers. **Special notes for your reviewer**: I have followed the steps described here [Changing the internal structures](https://github.com/kubernetes/community/blob/master/contributors/devel/api_changes.md) I have run the following scripts: hack/update-codegen.sh hack/update-generated-protobuf.sh hack/update-codecgen.sh hack/update-openapi-spec.sh hack/update-swagger-spec.sh hack/update-federation-openapi-spec.sh hack/update-api-reference-docs.sh See also: #[38755](https://github.com/kubernetes/kubernetes/pull/38755) #[38835](https://github.com/kubernetes/kubernetes/pull/38835#event-914403188) **Release note**: Extended meta.v1.APIResource by a list of short names. The short names would be used to allow kubectl to have short names representations of resources from aggregated API servers.
parents 15466fcc 1c924ccd
......@@ -34531,6 +34531,13 @@
"description": "namespaced indicates if a resource is namespaced or not.",
"type": "boolean"
},
"shortNames": {
"description": "shortNames is a list of suggested short names of the resource.",
"type": "array",
"items": {
"type": "string"
}
},
"verbs": {
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)",
"type": "array",
......@@ -3182,6 +3182,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -322,6 +322,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -535,6 +535,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -1467,6 +1467,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -3162,6 +3162,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -90,6 +90,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -1166,6 +1166,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -10737,6 +10737,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -1477,6 +1477,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -3381,6 +3381,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -3381,6 +3381,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -990,6 +990,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -20280,6 +20280,13 @@
"type": "string"
},
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)"
},
"shortNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "shortNames is a list of suggested short names of the resource."
}
}
}
......
......@@ -2287,6 +2287,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -5060,7 +5067,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:49:24 UTC
Last updated 2017-01-25 20:38:35 UTC
</div>
</div>
</body>
......
......@@ -892,6 +892,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -907,7 +914,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-12-08 13:47:09 UTC
Last updated 2017-01-25 20:38:39 UTC
</div>
</div>
</body>
......
......@@ -761,6 +761,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1168,7 +1175,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-12-08 13:47:16 UTC
Last updated 2017-01-25 20:38:43 UTC
</div>
</div>
</body>
......
......@@ -1304,6 +1304,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1375,7 +1382,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:49:44 UTC
Last updated 2017-01-25 20:38:47 UTC
</div>
</div>
</body>
......
......@@ -2198,6 +2198,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -4992,7 +4999,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:49:51 UTC
Last updated 2017-01-25 20:38:51 UTC
</div>
</div>
</body>
......
......@@ -479,6 +479,13 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -494,7 +501,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-12-08 13:47:37 UTC
Last updated 2017-01-25 20:38:55 UTC
</div>
</div>
</body>
......
......@@ -1199,6 +1199,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1364,7 +1371,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:03 UTC
Last updated 2017-01-25 20:38:59 UTC
</div>
</div>
</body>
......
......@@ -6131,6 +6131,13 @@ Both these may change in the future. Incoming requests are matched against the h
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -7609,7 +7616,7 @@ Both these may change in the future. Incoming requests are matched against the h
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:10 UTC
Last updated 2017-01-25 20:39:03 UTC
</div>
</div>
</body>
......
......@@ -1297,6 +1297,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1409,7 +1416,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:17 UTC
Last updated 2017-01-25 20:39:08 UTC
</div>
</div>
</body>
......
......@@ -1494,6 +1494,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1730,7 +1737,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:30 UTC
Last updated 2017-01-25 20:39:16 UTC
</div>
</div>
</body>
......
......@@ -1377,6 +1377,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1730,7 +1737,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:24 UTC
Last updated 2017-01-25 20:39:12 UTC
</div>
</div>
</body>
......
......@@ -1142,6 +1142,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -1213,7 +1220,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:50:36 UTC
Last updated 2017-01-25 20:39:20 UTC
</div>
</div>
</body>
......
......@@ -7086,6 +7086,13 @@ Examples:<br>
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">shortNames is a list of suggested short names of the resource.</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 array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
......@@ -9233,7 +9240,7 @@ Examples:<br>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2017-01-24 14:49:17 UTC
Last updated 2017-01-25 20:38:30 UTC
</div>
</div>
</body>
......
......@@ -10482,6 +10482,13 @@
"description": "namespaced indicates if a resource is namespaced or not.",
"type": "boolean"
},
"shortNames": {
"description": "shortNames is a list of suggested short names of the resource.",
"type": "array",
"items": {
"type": "string"
}
},
"verbs": {
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)",
"type": "array",
......
......@@ -280,6 +280,20 @@ var OpenAPIDefinitions *openapi.OpenAPIDefinitions = &openapi.OpenAPIDefinitions
},
},
},
"shortNames": {
SchemaProps: spec.SchemaProps{
Description: "shortNames is a list of suggested short names of the resource.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
},
Required: []string{"name", "namespaced", "kind", "verbs"},
},
......
......@@ -74,6 +74,9 @@ message APIResource {
// verbs is a list of supported kube verbs (this includes get, list, watch, create,
// update, patch, delete, deletecollection, and proxy)
optional Verbs verbs = 4;
// shortNames is a list of suggested short names of the resource.
repeated string shortNames = 5;
}
// APIResourceList is a list of APIResource, it is used to expose the name of the
......
......@@ -648,6 +648,8 @@ type APIResource struct {
// verbs is a list of supported kube verbs (this includes get, list, watch, create,
// update, patch, delete, deletecollection, and proxy)
Verbs Verbs `json:"verbs" protobuf:"bytes,4,opt,name=verbs"`
// shortNames is a list of suggested short names of the resource.
ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,5,rep,name=shortNames"`
}
// Verbs masks the value so protobuf can generate
......
......@@ -54,6 +54,7 @@ var map_APIResource = map[string]string{
"namespaced": "namespaced indicates if a resource is namespaced or not.",
"kind": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')",
"verbs": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)",
"shortNames": "shortNames is a list of suggested short names of the resource.",
}
func (APIResource) SwaggerDoc() map[string]string {
......
......@@ -115,6 +115,11 @@ func DeepCopy_v1_APIResource(in interface{}, out interface{}, c *conversion.Clon
*out = make(Verbs, len(*in))
copy(*out, *in)
}
if in.ShortNames != nil {
in, out := &in.ShortNames, &out.ShortNames
*out = make([]string, len(*in))
copy(*out, *in)
}
return nil
}
}
......
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