1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-01 23:03:28 +00:00
Commit Graph

236 Commits

Author SHA1 Message Date
Michael Bolot
7b5a48f871 Adding user authentication failed context value 2022-08-04 20:39:40 -05:00
Kinara Shah
3c8925cc12 wait for svc account secret to be populated with token 2022-06-28 16:25:00 -07:00
Jiaqi Luo
485ebe48a9 generate a service account token to make it work in 1.24 2022-06-24 15:47:22 -07:00
Kinara Shah
d26d34631a
Merge pull request #50 from ebauman/v1.24.0 2022-06-24 15:44:43 -07:00
Colleen Murphy
11fe86ab7e Make watch timeout configurable
By default, a watch times out after 30 minutes. For debugging purposes,
it's convenient if this can be decreased. Add an environment variable
CATTLE_WATCH_TIMEOUT_SECONDS to enable setting the timeout in seconds.
2022-06-13 16:01:55 -07:00
Colleen Murphy
ada5b33d98 Return websocket error and add logging for watches
Add debug logs and send websocket messages when the watch is closed
unexpectedly.

In addition to being helpful for debugging, the dashboard specifically
looks for a `resource.error` event containing the string "too old" in
order to trigger the watch to be resynced with a refreshed revision
number.  Without this error returned, the dashboard will only see
`resource.stop` events and never change its behavior, continuing to try
to restart the watch with an incorrect resource version.
2022-06-13 15:54:40 -07:00
Eamon Bauman
3ccc837e84 webhook setup requires rest.Config now 2022-05-25 18:49:28 -05:00
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
Darren Shepherd
09d79b238b Normalize conditions 2020-09-22 13:46:46 -07:00
Darren Shepherd
8db386d225 If no namespace access at all still include list 2020-09-18 17:19:14 -07:00
Darren Shepherd
7c151f76f8 Ensure that impersonation pods are deleted after an hour 2020-09-17 12:23:07 -07:00
Darren Shepherd
cfede8c002 Make podimpersonation image configurable 2020-09-10 23:56:18 -07:00
Darren Shepherd
e106b9e16b Remove userpreferences from steve 2020-09-10 23:04:28 -07:00
Darren Shepherd
d496dd31d1 Convert array/map of native types properly 2020-09-10 21:34:27 -07:00
Darren Shepherd
9b7fcc9a01 Use local scheme for parameter decoding 2020-09-09 15:19:21 -07:00
Darren Shepherd
e81a4e2c6e Allow service account auth to work with Transport/WrapTransport set 2020-09-09 12:00:04 -07:00
Darren Shepherd
1b98deb6c9 Set x-forwarded-proto if unset and needed. 2020-09-08 14:30:46 -07:00
Darren Shepherd
cfcf1a5196 Support service accounts through the proxy by supporting bearer tokens 2020-09-06 21:30:17 -07:00
Darren Shepherd
f0b94379d1
Merge pull request #8 from ibuildthecloud/master
Don't return revision in counts and only return error/transitions states
2020-08-27 21:31:01 -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
4911ec913f Support lookups where user.Info refers to a serviceaccount. 2020-08-11 10:59:02 -07:00
Darren Shepherd
6ebfa39af8 Metadata field should be create/update=true 2020-08-10 12:43:05 -07:00
Darren Shepherd
f3edb7357f Bump to shell:v0.0.10 2020-08-07 15:21:03 -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
a3fbe499d1 testing 2020-07-24 01:42:00 -07:00
Darren Shepherd
f403507ea9 Always calculate state from current object, not cached object 2020-07-21 08:26:28 -07:00
Darren Shepherd
10b1eac592 Fix concurrent map access panic 2020-07-21 08:26:08 -07:00
Darren Shepherd
4e81175966 Reenabled events 2020-07-20 09:21:18 -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
ece0f7bce5 Rename to RESTConfig 2020-07-19 13:56:34 -07:00
Darren Shepherd
969e1adfed Add podimpersonation package 2020-07-19 13:55:34 -07:00
Darren Shepherd
34e6de07fb Make notifier optional 2020-07-14 13:28:21 -07:00
Darren Shepherd
f4ef308923 Drop rancher auth 2020-07-14 13:27:58 -07:00
Darren Shepherd
33b6924291 Update imports for wranger-api 2020-07-14 13:27:47 -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
5c768508bb Fix broken create. 2020-06-12 14:18:13 -07:00
Darren Shepherd
4c61f95a6a Don't redirect by default to dashboard 2020-06-12 14:17:57 -07:00
Darren Shepherd
d1a7dbb0b9 Shuffle around code and use rancher/apiserver 2020-06-11 21:51:19 -07:00
Darren Shepherd
2543926f99 Fix missing links on configmaps and secret 2020-06-10 21:18:22 -07:00
Darren Shepherd
8b9bea44c6 Don't cancel context of subscribe on method exit 2020-06-10 15:46:19 -07:00
Darren Shepherd
72db28d5ea Fix map concurrent read/write 2020-06-08 13:10:07 -07:00
Darren Shepherd
2eb87bffc1 Add fields to cluster 2020-06-05 20:45:26 -07:00
Darren Shepherd
0849182bdd Ensure that userpreferences always works. 2020-06-05 17:19:07 -07:00
Darren Shepherd
b60484bf2e Add support for listing helm releases 2020-06-05 13:30:33 -07:00
Darren Shepherd
445acdc240 Increase security around cluster shell 2020-06-02 08:51:42 -07:00
Darren Shepherd
3eba71d06b Add kubectl shell support 2020-06-01 15:59:38 -07:00
Darren Shepherd
d3ce9c1739 Add virtual clusters resource 2020-05-30 21:45:11 -07:00
Darren Shepherd
1336014def Add authentication by default 2020-05-30 19:02:49 -07:00