Commit Graph

41 Commits

Author SHA1 Message Date
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
Ricardo Weir
e9472ecc34 Add metrics 2022-02-14 17:39:37 -07:00
CMC
fea67065db
feat: support k8s version less than 1.16 2021-11-25 16:16:20 +08:00
Darren Shepherd
bcbcef36b3 Add blocked links for update and remove if method is disallowed 2021-08-16 15:41:36 -07:00
Darren Shepherd
4a34cec914 Add server version to websocket pings 2021-08-10 16:09:19 -07:00
Darren Shepherd
426330efa2 Ensure that watches use the latest schemas 2021-08-10 11:03:59 -07:00
Darren Shepherd
9f5d802708 Cleanup schema change reporting 2021-08-09 16:47:09 -07:00
Darren Shepherd
c6547ae887 Fix possible panic on race condition 2021-05-10 15:06:15 -07:00
Darren Shepherd
c1ea7b9626 Register apply structs 2021-03-01 22:39:52 -07:00
Darren Shepherd
6b2a9678f1 Add userpreference 2021-03-01 22:26:26 -07:00
Darren Shepherd
df96a3bd4a Add fake cluster object and move apply action to core steve 2021-03-01 17:13:14 -07:00
Daishan
15808f524c Add self link 2021-01-06 10:50:59 -07:00
Darren Shepherd
a44863b331 Switch clustercache to index by gvk not gvr 2020-10-23 13:57:57 -07:00
Darren Shepherd
f86e19a301 Don't put an update link if update is not allowed 2020-09-29 10:47:59 -07:00
Darren Shepherd
09d79b238b Normalize conditions 2020-09-22 13:46:46 -07:00
Darren Shepherd
e106b9e16b Remove userpreferences from steve 2020-09-10 23:04:28 -07:00
Darren Shepherd
53e5a27ce7 Don't return revision in counts and only return error/transitions states 2020-08-27 21:28:37 -07:00
Darren Shepherd
a528c500cf Set pod status to state 2020-08-03 19:52:04 -07:00
Darren Shepherd
dcea1db3d7 Remove clusters and helm release resources 2020-07-29 21:47:58 -07:00
Darren Shepherd
10b1eac592 Fix concurrent map access panic 2020-07-21 08:26:08 -07:00
Darren Shepherd
e27f384795 Only send counts every second if there is a change 2020-07-20 09:21:03 -07:00
Darren Shepherd
969e1adfed Add podimpersonation package 2020-07-19 13:55:34 -07:00
Darren Shepherd
a9c39ef89b Support watching names and selector 2020-06-22 09:42:18 -07:00
Darren Shepherd
9571ce9890 Fix shell 2020-06-22 09:41:48 -07:00
Darren Shepherd
d796ed60a7 Show resource relationships 2020-06-22 08:49:49 -07:00
Darren Shepherd
d1a7dbb0b9 Shuffle around code and use rancher/apiserver 2020-06-11 21:51:19 -07:00
Darren Shepherd
19c6732de0 Vendor 2020-01-30 22:01:21 -07:00
Darren Shepherd
c7d1ea5729 Fix counts delete 2019-09-11 14:27:44 -07:00
Darren Shepherd
fab677b2ec Steve! 2019-09-11 14:05:00 -07:00
Darren Shepherd
9e4f93989f Switch schema ID to gvk and plural name to gvr 2019-09-11 11:03:22 -07:00
Darren Shepherd
7f5d248680 Fix off by one and 404 2019-09-09 14:34:40 -07:00
Darren Shepherd
f81721ef93 Improve counts and columns 2019-09-09 14:28:55 -07:00
Darren Shepherd
5142b5c386 Cleanup counts 2019-08-16 11:40:42 -07:00
Darren Shepherd
b059dcca00 Cleanup around APIRoots 2019-08-14 13:51:13 -07:00
Darren Shepherd
6d2b0f54ca Make / and /v1 work 2019-08-14 13:39:08 -07:00
Darren Shepherd
59a6ee577e Add apigroups 2019-08-14 13:13:26 -07:00
Darren Shepherd
f2c0706220 Add format to columns 2019-08-14 11:16:37 -07:00
Darren Shepherd
583309b969 Add column support 2019-08-14 11:08:34 -07:00
Darren Shepherd
db650d6c19 Switch schema IDs to be dot separated 2019-08-13 19:00:29 -07:00
Darren Shepherd
ad67c46055 Refactor schema IDs and paths 2019-08-13 16:36:03 -07:00
Darren Shepherd
f4898c6187 Add view/update links for resource that go to k8s proxy 2019-08-07 22:43:10 -07:00