1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-12 13:31:57 +00:00
Commit Graph

179 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
Jake Hyde
6bb3915906 Prevent write on closed channel 2022-03-02 19:19:02 -05:00
Ricardo Weir
e9472ecc34 Add metrics 2022-02-14 17:39:37 -07:00
michelia
42c575a009 Fixed errors in obtaining object relationships
Issue: https://github.com/harvester/harvester/issues/1857
2022-01-26 19:31:03 +08:00
CMC
fea67065db feat: support k8s version less than 1.16 2021-11-25 16:16:20 +08:00
Ryan Sanna
fe125f80f3 fix role revision index for rolebindings that bind to clusterroles 2021-09-14 15:36:51 -07:00
Darren Shepherd
e70fca2a42 Fix restart of steve aggregation 2021-08-16 22:05:50 -07: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
d9512c366d Add ability to disallow methods per a schema attribute 2021-08-13 11:37:57 -07:00
Darren Shepherd
4a34cec914 Add server version to websocket pings 2021-08-10 16:09:19 -07:00
Darren Shepherd
b219ba5d7c Don't cache the user's schema cache key 2021-08-10 14:02:22 -07:00
Darren Shepherd
426330efa2 Ensure that watches use the latest schemas 2021-08-10 11:03:59 -07:00
Darren Shepherd
0414d4acf5 If the user doesn't specify a resourceVersion default to "" not latest 2021-08-10 10:43:34 -07:00
Darren Shepherd
9f5d802708 Cleanup schema change reporting 2021-08-09 16:47:09 -07:00
Darren Shepherd
bb76e4db56 Strip impersonation headers prior to proxy call 2021-08-04 15:03:57 -07:00
Darren Shepherd
bed06c1320 Drop unused variable 2021-08-04 15:03:57 -07:00
Darren Shepherd
eba8358f2a Fix issues when creating clusterrolebindings to namespaces objects 2021-07-23 23:46:03 -07:00
Darren Shepherd
991a2a1776 Don't mask errors when doing by name lookups 2021-07-23 23:45:13 -07:00
Darren Shepherd
52f86dce9b Remove noisy logging 2021-05-20 12:10:28 -07:00
Darren Shepherd
a1ef4004f8 Implement generic CanDo against k8s roles 2021-05-18 22:34:46 -07:00
Darren Shepherd
43139e348a Make handshake timeout consistent with rancher agent 2021-05-10 15:06:46 -07:00
Darren Shepherd
c6547ae887 Fix possible panic on race condition 2021-05-10 15:06:15 -07:00
Daishan
30042ac3a0 Don't append CA if url is behind public CA 2021-05-03 17:51:44 -07:00
Darren Shepherd
86ca5628f7 Make aggregation start explicitly or on Listen 2021-05-03 15:38:46 -07:00
Darren Shepherd
9ddd83c343 Fix openapi schema to steve schema generation 2021-04-27 17:08:38 -07:00
Darren Shepherd
33c5220756 Update to new FrameOptions API from apiserver 2021-04-22 17:22:32 -07:00
Daishan
28260701a5 Update wrangler to use v1 apiextention 2021-04-21 09:49:03 -07:00
Daishan
2309fbbd2e Add ability to support registryOverride 2021-04-06 14:50:46 -07:00
Darren Shepherd
376934558c Add ability to aggregate steve servers through remotedialer 2021-03-18 10:13:16 -07:00
Darren Shepherd
362617a677 Add ability to add multiple schematemplates per type 2021-03-02 07:30:00 -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
Darren Shepherd
2cf9f857b0 Merge pull request #14 from guangbochen/harvester-v0.2
Add default api server and fix invalid open-api arbitrary type
2021-02-19 09:21:18 -08:00
Darren Shepherd
e8086b4525 Add UI back to steve 2021-02-18 10:36:27 -07:00
Darren Shepherd
00da04b7d5 Force autoscaling to use v2beta2 API 2021-01-25 17:19:43 -07:00
Guangbo Chen
8891a7756b Presume json type for Open API Arbitrary type 2021-01-11 15:11:04 +08:00
Guangbo Chen
0edf9c780f Add default api-server option 2021-01-11 15:10:37 +08:00
Daishan
15808f524c Add self link 2021-01-06 10:50:59 -07:00
Darren Shepherd
b30a203a7c Update to k8s v1.20 2020-12-08 16:33:32 -07:00
Daishan
5c32b4fb03 Add disable filter to allow exec/logs 2020-11-10 11:33:58 -07:00
Darren Shepherd
3df58506a2 Add ability to get dynamic client 2020-10-30 16:08:28 -07:00
Darren Shepherd
92638937df Add state info to relationships 2020-10-23 14:00:11 -07:00
Darren Shepherd
a44863b331 Switch clustercache to index by gvk not gvr 2020-10-23 13:57:57 -07:00
Darren Shepherd
12b7626eda Don't drop schemas that have existing authorization 2020-10-22 17:03:41 -07:00
Darren Shepherd
c84c1b52af Fix impersonating serviceaccounts for podimpersonation 2020-10-21 22:39:34 -07:00
Darren Shepherd
e7858849e9 Send 401 not 403 for local cluster proxy when unauthed 2020-09-30 11:23:48 -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
a8ce2f5ec8 Ensure we send an error when the resource version is too old. 2020-09-27 17:51:52 -07:00
Darren Shepherd
4e31a4b24b Close watch channel on exit 2020-09-25 18:03:59 -07:00