1
0
mirror of https://github.com/rancher/steve.git synced 2025-07-19 09:17:07 +00:00
steve/pkg
Colleen Murphy d4cfe78364 Add field filtering for resources
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": ""
        },
        ...
      },
      ...
    ]
  }
2022-04-13 08:50:39 -07:00
..
accesscontrol fix role revision index for rolebindings that bind to clusterroles 2021-09-14 15:36:51 -07:00
aggregation Fix restart of steve aggregation 2021-08-16 22:05:50 -07:00
attributes Add ability to disallow methods per a schema attribute 2021-08-13 11:37:57 -07:00
auth Update to k8s v1.20 2020-12-08 16:33:32 -07:00
client feat: support k8s version less than 1.16 2021-11-25 16:16:20 +08:00
clustercache Switch clustercache to index by gvk not gvr 2020-10-23 13:57:57 -07:00
controllers/schema Remove noisy logging 2021-05-20 12:10:28 -07:00
debug Refactor 2020-01-30 22:37:59 -07:00
metrics Add metrics 2022-02-14 17:39:37 -07:00
podimpersonation Add ability to support registryOverride 2021-04-06 14:50:46 -07:00
proxy Strip impersonation headers prior to proxy call 2021-08-04 15:03:57 -07:00
resources Add field filtering for resources 2022-04-13 08:50:39 -07:00
schema Add ability to disallow methods per a schema attribute 2021-08-13 11:37:57 -07:00
server Add server version to websocket pings 2021-08-10 16:09:19 -07:00
stores Add metrics 2022-02-14 17:39:37 -07:00
summarycache Prevent write on closed channel 2022-03-02 19:19:02 -05:00
ui Update to new FrameOptions API from apiserver 2021-04-22 17:22:32 -07:00
version Initial commit 2019-08-04 10:41:32 -07:00