Commit Graph

107 Commits

Author SHA1 Message Date
Alejandro Ruiz 8e294f7a0b
Vai encoding benchmark (#742)
Also includes some misc changes.
2025-09-17 09:33:33 +02:00
Tom Lebreux 13d5ad3ccb
Stop single caches instead of all of them (#812)
* Revert OnSchemas change work

* Track schema changes

* Only stop a single GVK informer factory

* Add tests

* Rename crd to crdClient

* Rename s to sqlStore

* Don't wait for synced caches if request is canceled

* Move schematracker to pkg/sqlcache/schematracker
2025-09-10 17:04:25 -04:00
Sakala Venkata Krishna Rohit 6946ffe8aa
Add an attribute observedgeneration (#714)
* Add an attribute observedgeneration

* add unit tests
2025-08-07 10:30:06 -07:00
Eric Promislow 5f08feeb5f
Reset db more selectively: approach #2 (#745)
* On Reset, remove all the sqlite files, not just the main one.

* Avoid resetting the database and cache when not needed.

Avoid resetting when a change doesn't bring in new schema fields.

Always reset when a CRD is deleted.

* Force a database reset when a new CRD is added.

* Improve code readability. No functional change.
2025-07-31 10:43:55 -07:00
Tom Lebreux 127d37391d
Better gc (#717)
* More error wrapping for SQL cache

* Use context.Context instead of stopCh

* Move CacheFor to Info log level

* Implement time-based GC

* Set default GC param when running standalone steve
2025-07-11 12:48:19 -04:00
Alejandro Ruiz 6495e7879c
Make waiting for ExtensionAPIServer configurable (#694) 2025-06-26 17:04:49 +02:00
Felipe Gehrke b3539616e0
#48673 - Added Timestamp Cache Handling to metadata.fields (#648)
* added timestamp convertion to metadata.fields

* fixed duration parsing

* fixed tests

* removed tags file

* added comments

* added better error handling

* changed ParseHumanDuration to use Fscanf

* added builtins handling

* adding mock updates

* fixing tests

* another try

* added timestamp convertion to metadata.fields

* addressing comments from @ericpromislow

* converting error to warning

* added template options
2025-06-16 15:33:28 -07:00
Josh Meranda c67ddf2de4
[main] block UI until we receive requests from kube-apiserver (#668)
* block UI until we receive requests from kube-apiserver

* satisfy CI

* undo test code

---------

Co-authored-by: joshmeranda <joshua.meranda@gmail.com>
2025-06-11 14:58:36 -04:00
Tom Lebreux f258ebcf31
Add garbage collection for events table (#664)
* Add ListOptionIndexerOptions to create ListOptionIndexer

* Remove unused function

* Implement configurable garbage collection on ListOptionIndexer

* Propagate Steve options from Server
2025-06-10 12:02:55 -04:00
Sakala Venkata Krishna Rohit da9bc2a114
Update urfave/cli to v2 (#523) 2025-04-08 12:46:32 -07:00
Silvio Moioli 3350323f91
sql: propagate and use contexts (#465)
Previous SQLite-related code used context.Background() and context.TODO() because it was not developed with context awareness.

This commit propagates the main Steve context so that it can be used when interacting with SQL context-aware functions.

This PR removes all production-code use of context.Background() and context.TODO() and replaces test-code use of TODO with Background.

Contributes to rancher/rancher#47825
2025-02-12 09:46:10 +01:00
Tom Lebreux 9dd9b0f625
Move lasso SQL cache in Steve (#452)
* Copy pkg/cache/sql from lasso to pkg/sqlcache

* Rename import from github.com/rancher/lasso/pkg/cache/sql to github.com/rancher/steve/pkg/sqlcache

* Fix filter.Match -> filter.Matches

* go mod tidy

* Fix lint errors

* Remove lasso SQL cache mentions

* Fix more CI lint errors

* fix goimports

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fix tests (Match -> Matches)

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* Fix Sort order

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
Co-authored-by: Silvio Moioli <silvio@moioli.net>
2025-01-17 09:34:48 -05:00
Eric Promislow d3269c91eb
Finish the AccessSet changes to the main formatter. (#308)
The original PR, steve/pull/158 drifted too far from changes
in main, so it's easier to create a new PR:

* Bring in and update DefaultSchemaTemplatesForStore
* Move from based on `master` to `main`
* Update k8s version
2025-01-07 12:20:26 -08:00
Tom Lebreux 8fc2dd4f74
Fix ExtensionAPIServer interface (#298)
* Fix comments
* Fix ExtensionAPIServer interface
2024-10-15 10:00:27 -04:00
Tom Lebreux 1f21e5e515
Implement /ext in Steve for Imperative API (#287)
This implements the Imperative API that is served at /ext with Steve. The imperative API is compatible with Kubernetes' API server and will be used as an extension API server.
2024-10-11 15:19:27 -04:00
Michael Bolot 1149920168 Adding virtual fields
Adds logic which adds virtual fields resources. This allows these fields
to be sorted/filtered on when the SQL cache is enabled. Id and
metadata.state.name were added as the first two fields.
2024-08-28 12:17:53 -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 (#223)
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 2f8e64840b Improving Schema Definitions cache/refresh
Updates the schema definitions refresh method to use a new debounce
method. Adds a handler which refreshes the definitions every 2
seconds after adding a CRD and every 10 minutes by default.
2024-03-12 13:49:39 -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
Michael Bolot c8fb653ca3 Bump dynamic listener to v0.3.5
Bumps dynamic listener to v0.3.5. Adds a small arg change to
account for this version bump which addresses an issue caused by
the new version
2022-12-13 16:12:33 -06:00
Colleen Murphy 70ea282861 cleanup: Fix API root header
The header defined in RFC 9110[1] is "Accept", not "Accepts". This
change corrects the route filter. Since this API is not documented and
the header was plainly incorrect, no attempt is made at backwards
compatibility.

[1] https://www.rfc-editor.org/rfc/rfc9110.html#name-accept
2022-10-27 14:27:13 -07:00
Colleen Murphy 95da447d90 cleanup: remove duplicate apiserver import
Remove duplicate import and make aliasing of other apiserver imports
consistent throughout steve.
2022-10-27 14:27:13 -07: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
Darren Shepherd 4a34cec914 Add server version to websocket pings 2021-08-10 16:09:19 -07:00
Darren Shepherd 86ca5628f7 Make aggregation start explicitly or on Listen 2021-05-03 15:38:46 -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 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
Guangbo Chen 0edf9c780f Add default api-server option 2021-01-11 15:10:37 +08: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 a3fbe499d1 testing 2020-07-24 01:42:00 -07:00
Darren Shepherd ece0f7bce5 Rename to RESTConfig 2020-07-19 13:56:34 -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 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 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 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