1
0
mirror of https://github.com/rancher/steve.git synced 2025-05-13 18:34:20 +00:00
Commit Graph

61 Commits

Author SHA1 Message Date
Michael Bolot
e7a76d14f0 Adding APIGroups back to the schema
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.
2024-07-02 13:27:04 -05:00
vardhaman22
dae842ea98 updated wrangler from v2 to v3
also updated k8s dependencies to v0.30.1
2024-06-05 22:53:08 +05:30
Silvio Moioli
7a84620e8b
SQLite backed cache ()
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>
2024-06-05 16:17:12 +02:00
Michael Bolot
0e9fde750f Attempting to fix flaky tests
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.
2024-04-03 15:32:23 -05:00
Jonathan Crowther
abbe805737 Change which object needs DeepCopy 2024-03-13 19:41:21 -04:00
Jonathan Crowther
cec59c5a61 Implement custom DeepCopy for Count 2024-03-01 11:56:18 -05:00
Jonathan Crowther
0e74495395 DeepCopy the count before sending it as APIEvent 2024-03-01 10:50:35 -05:00
Michael Bolot
40f6b10fc7 Adding schema definitions endpoint
Introduces new schema definitions endpoint, allowing the caller to get
the fields/types/descriptions for a given kubernetes resource.
2024-02-26 15:42:03 -06:00
Kevin Joiner
e35a044d5a Bumps rancher/wrangler to it's tagged v2 version.
The previous wrangler commit included all of the v2 changes.
Except for the import paths changes.
2024-01-24 10:24:01 -05:00
Colleen Murphy
84dedac146 Add projectsornamespaces query parameter
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
2023-05-11 14:17:39 -07:00
Colleen Murphy
9a386b205c Fix resource counts unit tests
Increase the timeout slightly to avoid the occasional premature timeout.
Fix error message typo.
2023-01-20 14:19:05 -08:00
Michael Bolot
956b7351aa
Initial implmentation of warning headers
Attempts to pass through warning headers which k8s returns.
Requires an update to rancher/apiserver.
2022-12-30 12:11:14 -05:00
Michael Bolot
8fdf67a444
Merge pull request from MbolotSuse/count-diff
Changing count watch to only return changed counts
2022-12-14 10:15:18 -06:00
Michael Bolot
37ee7bf3bd
Merge pull request from MbolotSuse/view-fix
Changing view links
2022-12-09 13:27:05 -06:00
Michael Bolot
fe51b08681 Tests for "Fixing view link for management crds" 2022-12-06 09:04:56 -06:00
Michael Bolot
b70a8d0548 Fixing view link for management crds 2022-12-06 09:04:31 -06:00
Kevin Joiner
72ab913c4c Updates Schemas watch logic.
Updated logic used to decide when and what schema events are sent
during a watch.
2022-10-27 22:12:39 -04:00
Michael Bolot
b73cc57b20 Adding validate phase to the CI
Adds a validate phase to the CI which runs a linter. Also fixes
linter issues discovered during the initial run
2022-10-14 15:21:17 -05:00
Michael Bolot
5cb45b9dcd Adding test for sending counts on diffs 2022-10-03 16:19:31 -05:00
Michael Bolot
2eb41a9db7 Only return changed counts, and send initial count
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
2022-10-03 16:12:11 -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
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