Prior schema calculations started with openapiv2 models which included a
model for APIGroups. However, new schema calculations use
ServerGroupsAndResources first, which omitted these values. This
re-adds this type using a static schema.
This uses SQLite-backed informers provided by Lasso with https://github.com/rancher/lasso/pull/65 to implement Steve API (/v1/) functionality.
This new functionality is available behind a feature flag to be specified at Steve startup
See https://confluence.suse.com/pages/viewpage.action?pageId=1359086083
Co-authored-by: Ricardo Weir <ricardo.weir@suse.com>
Co-authored-by: Michael Bolot <michael.bolot@suse.com>
Co-authored-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: Silvio Moioli <silvio@moioli.net>
Some tests which relied on timeouts were a bit flaky in CI. This PR
refactors a few of them to work on a more reliable method of receiving
from a channel and raises the timeout of another test.
Add a new query parameter to filter resources by their namespace or
their namespace's project. This parameter is separate from the existing
`filter` parameter.
Filter by a comma-separated list of projects and/or namespaces with:
?projectsornamespaces=p1,n1,n2
The result can be negated with the ! operator:
?projectsornamespaces!=p1,n1,n2
Three main changes:
- When a count changes, only send that count. This makes the
count socket significantly more usable
- The count buffer will now send a count right away. This allows
a message to launch wihtout an inital buffered wait period
- The count buffer now sends messages every 5 seconds instead of 1
This change enables steve to work with three new query parameters:
"include": only include the named fields from the kubernetes object.
Subfields are denoted with ".". Subfields within arrays are ignored.
Multiple fields can be included by repeating the parameter. Example:
GET /v1/configmaps?include=kind&include=apiVersion =>
{
"type": "collection",
"links": {
"self": "http://server/v1/configmaps"
},
"createTypes": {
"configmap": "http://server/v1/configmaps"
},
"actions": {},
"resourceType": "configmap",
"revision": "327238",
"data": [
{
"id": "c-m-w466b2vg/kube-root-ca.crt",
"type": "configmap",
"links": {
"remove": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"self": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"update": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"view": "http://server/api/v1/namespaces/c-m-w466b2vg/configmaps/kube-root-ca.crt"
},
"apiVersion": "v1",
"kind": "ConfigMap"
},
}
...
}
"exclude": exclude the named fields from the kubernetes object.
Subfields are denoted with ".". Subfields within arrays are ignored.
Multiple fields can be excluded by repeating the parameter. Example:
GET /v1/configmaps?exclude=data&exclude=metadata.managedFields =>
{
"type": "collection",
"links": {
"self": "http://server/v1/configmaps"
},
"createTypes": {
"configmap": "http://server/v1/configmaps"
},
"actions": {},
"resourceType": "configmap",
"revision": "328086",
"data": [
{
"id": "c-m-w466b2vg/kube-root-ca.crt",
"type": "configmap",
"links": {
"remove": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"self": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"update": "http://server/v1/configmaps/c-m-w466b2vg/kube-root-ca.crt",
"view": "http://server/api/v1/namespaces/c-m-w466b2vg/configmaps/kube-root-ca.crt"
},
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": {
"creationTimestamp": "2022-04-11T22:05:27Z",
"fields": [
"kube-root-ca.crt",
1,
"25h"
],
"name": "kube-root-ca.crt",
"namespace": "c-m-w466b2vg",
"relationships": null,
"resourceVersion": "36948",
"state": {
"error": false,
"message": "Resource is always ready",
"name": "active",
"transitioning": false
},
"uid": "1c497934-52cb-42ab-a613-dedfd5fb207b"
}
},
...
}
"excludeValues": replace the values of an object with empty strings, leaving
the keys in place. Useful for showing a summary of an object with large
values, such as the data in a ConfigMap. Only works on fields that are
object. Multiple fields can have values excluded by repeating the
parameter. Example:
GET /v1/configmaps?excludeValues=data =>
{
"type": "collection",
...
"data": [
{
...
"data": {
"ca.crt": ""
},
...
},
...
]
}