1
0
mirror of https://github.com/rancher/steve.git synced 2025-07-10 13:23:30 +00:00
Commit Graph

587 Commits

Author SHA1 Message Date
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
Tom Lebreux
d05a48f9cf
Fix overriding update and remove links with the wrong link (#451) 2025-01-15 11:15:47 -08:00
Tom Lebreux
fdf2ef8e93
Partial extension API server store + control over printed columns (#432)
* Checkpoint

* Add support for custom columns

* Remove old Store and Delegate abstraction

* Fix nits and rewording

* Remove unused mock file

* Update documentation for extension api server

* Remove the need for scheme for ConvertListOptions

* Rename store to utils

* fixup! Remove the need for scheme for ConvertListOptions

* Move watch helper to tests

* Add convertError at a few places

* Ignore misspell on creater

* Fix comments and remove unused params

* Add convertError to missing error returns

* Fix watcher implementation

* Document request.UserFrom and request.NamespaceFrom
2025-01-15 12:41:44 -05:00
Tom Lebreux
4477e2c1c4
Add indexed field Event.involvedObject.uid (#439) 2025-01-14 08:33:44 +01:00
Silvio Moioli
e70d03d6ce
sort typeSpecificIndexedFields lexicographically (#437) 2025-01-11 12:26:44 +01:00
Tom Lebreux
8666ce1f54
Update indexed fields (#433)
* Update indexed fields

* Add .status.currentReplicas
2025-01-09 09:35:49 -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
Silvio Moioli
5e15f22b0d
SQLite backed cache: indexed fields round #4 (#430)
* Change indexed fields according to https://github.com/rancher/rancher/issues/48256wq

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

* Fix typo

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-12-19 11:01:09 -05:00
Silvio Moioli
58f2264f16
sql: silence informer errors on unwatchable resources (#284)
* bump lasso to include pull #111

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

* Make IsListWatchable public to be reused in other packages

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

* Let lasso know whether a type is watchable upon requesting a cache

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

* Adapt existing tests

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

* Add a test to check watchability is detected correctly

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

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-12-19 04:53:10 -05:00
Silvio Moioli
65129458a7
cache/sql: add more indexed fields (#400)
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-12-06 15:59:02 -08:00
Josh Meranda
61e80cffc8
Implement versioning ADR (#321)
* update renovate

* add release workflow

* document versioning

---------

Co-authored-by: joshmeranda <joshua.meranda@gmail.com>
2024-11-15 10:29:32 -05:00
Felipe Gehrke
ea177193f1
#47568 - Added delegateError + Improve delegate Test Coverage (#318)
* added delegate error / improve delegate coverage / add new mocks

* fixing ci lint

* addressing comments from @ericpromislow

* addressing comments from @tomleb

* fixing apistatus type casting assert
2024-11-14 16:34:35 -03:00
Felipe Gehrke
6ee8201c8d
#47483 - Adding NonResourceURLs support to AccessStore (#299)
* adding NonResourceURLs support to access_store

* added tests to AccessSet NonResourceURLs handling

* change on test script suggested by @tomleb + go mod tidy

* added nonresource to ext api authorization

* added NonResourceURLs implementation in Authorizes + test

* removed non-resource-url tests from the main test

* added new tests for non-resource-urls

* removed unused test data

* changed nonResourceKey to point to struct{}

* addressed comments from @tomleb

* addressed more comments

* fixing typo

* check for empty accessSet
2024-11-04 23:47:48 -03:00
nflynt
2175e090fe
Refactor ID based partitioning, add unit tests (#309)
* Refactor ID based partitioning, add unit tests

This resolves an issue where the requested namespace filter was not
always honored.

* Correct naming issues to appease the linter
2024-10-29 09:27:12 -04:00
Diogo Souza
b2f2bab3c4
Helm data formatter (#305)
* changing secret and configmap formatters to return decoded helm data if includeHelmData query parameter is present

* adding tests for gzip magic header
2024-10-28 15:55:36 -05:00
Alejandro Ruiz
fd9a516ecb
refactor(accesscontrol): deterministic cache key hashing (#292)
* refactor(accesscontrol): make addAccess directly accept PolicyRules

* refactor(accesscontrol): add new types for encapsulating all needed data

* refactor(accesscontrol): make getRules return resource version

* refactor(accesscontrol): add new getRoleRefs to policyRuleIndex

* refactor(accesscontrol): make accessStore use the new types and method

* cleanup(accesscontrol): remove unused code

* cleanup(accesscontrol): adapt tests

* cleanup(accesscontrol): add some comments and remove unused function

* refactor(accesscontrol): rework indexer to make it more readable and testable

* Fix typo

* test: consistent use of t.Error

* test: refactor policyRulesMock to just use a map

* misc: rename toUserInfo function

* refactor: consistent sort by UID
2024-10-28 09:35:59 +01:00
Eric Promislow
06c2eb50d1
Index more sqlite cache fields (#271)
* Add more fields to index when sql-caching is on.

Misc changes:
- Use the builtin Event class, not events.k8s.io (by looking at the dashboard client code)
- Specify full path to the management.cattle.io fields.
- Map `Event.type` to `Event._type` for indexing.

Use a compound transform-func to first check for a "signal",
and then to run all the relevant transformers until either
one fails or the list is exhausted.

- Includes moving the fakeSummaryCache type into a common area.

Use a simpler way of running transforms.

* Inline the function to get the gvk key.

* Create a '--sql-cache' flag to turn on caching for the steve CLI.

* Improve error-handling in object transformer.

* Drop the 'GetTransform' function.

* Inline the code that transforms a payload into a k8s-unstructured object.
2024-10-18 11:06:29 -07:00
Michael Bolot
f6c6ca839c
Re-adding formatter when SQL cache is enabled (#300)
Previously, the formatter for state/relationships was disabled when the
sql cache was enabled, since a transform function was adding those
values before they were added to the cache. However, the get/watch calls
currently don't use the cache, causing the state/relationships to be
missing.
2024-10-18 12:15:42 -05: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
Eric Promislow
57a25ffa82
Bump to k8s 1.31 (#294) 2024-10-10 13:14:17 -07:00
Eric Promislow
6a11ffb660
Migrate the mocking library to uber's (#291)
* Migrate from golang/mock to uber/mock.

* Update go.mod

* Continue migration to uber/mock.

* Tweaks from running the go.uber.mock's mockgen.
2024-10-10 10:28:25 -07:00
Alejandro Ruiz
484ce1c9e9
refactor(accesscontrol): use interface for AccessStore cache (#290) 2024-10-09 10:21:29 +02:00
Alejandro Ruiz
5c1a56204d
Add tests for concurrent AccessControl store usage (#286)
* refactor(accesscontrol): use interface for AccessStore cache

* refactor(accesscontrol): early return when cache is disabled

* test(accesscontrol): add failing unit test

* test(accesscontrol): skip failing test
2024-10-08 11:18:44 -04:00
Felipe Gehrke
99e479ba0f
Adding Group, Version, Kind in Update proxy_store.go (#270)
* adding gvk completion to update method in proxy_store
2024-09-13 15:19:58 -03:00
Silvio Moioli
f02f3f9411
README: SQLite specify encryption limitations (#269)
Co-authored-by: Paulo Gomes <paulo.gomes@suse.com>
2024-09-10 09:38:42 +02:00
Tom Lebreux
28630459d0
Bump Go to 1.22.7 (#274) 2024-09-09 10:54:06 -04:00
Felipe Gehrke
e930ae3691
Added Namespace check to proxy_store.go Create (#272)
* added namespace check to proxy_store create

* added namespaced resources checks and create tests

* Update pkg/stores/proxy/proxy_store.go

* changed error message and added missing name only test

* updated sql/proxy_store

* changed return to use apierror.NewAPIError

---------

Co-authored-by: Felipe C. Gehrke <felipe@localhost.localdomain>
Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
2024-09-06 17:25:32 -03:00
Eric Promislow
eb6026e93c
Merge pull request #273 from ericpromislow/46956-bump-dynamic-listener
Display error output from dynamiclistener.Server when in debug mode.
2024-09-05 15:31:08 -07:00
Eric Promislow
69906c52af Display error output from dynamiclistener.Server. 2024-09-05 12:00:54 -07:00
Michael Bolot
ea6c83b279
Merge pull request #264 from MbolotSuse/virtual-filter
Virtual Resource filters
2024-08-30 07:58:33 -05: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
Alejandro Ruiz
32c30149a6
refactor(accesscontrol): add unit tests for CacheKey (#245)
This is a follow up to 435e220 with a small refactor to make the function easier to test, and adding unit tests for CacheKey.
2024-08-28 10:06:21 +02:00
renovate-rancher[bot]
01429f8528
chore(deps): update github.com/rancher/norman digest to 60ccfab (#266)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2024-08-27 10:17:08 -04:00
Silvio Moioli
5ec7c773df
README: document API differences when SQLite caching is enabled (#262)
* README: make common header for list parameters
* README: document differences when SQLite caching is enabled
* README: clarify support of sorting with the SQL cache
* README: mention additional printer columns

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-08-20 13:28:40 +02:00
Eric Promislow
6d0d007ad5
Merge pull request #228 from rancher/renovate/registry.suse.com-bci-bci-micro-15.x
chore(deps): update registry.suse.com/bci/bci-micro docker tag to v15.6
2024-08-16 16:32:15 -07:00
Eric Promislow
d604ed6d31
Merge pull request #242 from rancher/renovate/github.com-adrg-xdg-0.x
chore(deps): update module github.com/adrg/xdg to v0.5.0
2024-08-16 15:25:43 -07:00
Eric Promislow
d5ba002edf
Merge pull request #222 from rancher/renovate/actions-setup-go-5.x
chore(deps): update actions/setup-go action to v5.0.2
2024-08-16 15:25:18 -07:00
Eric Promislow
629030e292
Merge pull request #259 from rancher/renovate/github.com-urfave-cli-v2-2.x
chore(deps): update module github.com/urfave/cli/v2 to v2.27.4
2024-08-16 15:24:33 -07:00
Eric Promislow
ee5e596d24
Merge pull request #251 from rancher/renovate/github.com-rancher-dynamiclistener-0.x
chore(deps): update module github.com/rancher/dynamiclistener to v0.6.0
2024-08-16 15:23:33 -07:00
Eric Promislow
3103180e19
Merge pull request #258 from rancher/renovate/github.com-rancher-lasso-digest
chore(deps): update github.com/rancher/lasso digest to 8da6f11
2024-08-16 15:22:23 -07:00
renovate-rancher[bot]
3291f8c741
chore(deps): update module github.com/urfave/cli/v2 to v2.27.4 2024-08-12 05:01:28 +00:00
renovate-rancher[bot]
6b53b33458
chore(deps): update registry.suse.com/bci/bci-micro docker tag to v15.6 2024-08-10 04:56:47 +00:00
renovate-rancher[bot]
98964a7e69
chore(deps): update module github.com/adrg/xdg to v0.5.0 2024-08-10 04:56:27 +00:00
renovate-rancher[bot]
2d08b36ea5
chore(deps): update module github.com/rancher/dynamiclistener to v0.6.0 2024-08-10 04:56:06 +00:00
renovate-rancher[bot]
9c0971fbe7
chore(deps): update actions/setup-go action to v5.0.2 2024-08-10 04:55:55 +00:00
renovate-rancher[bot]
bff7f104ee
chore(deps): update github.com/rancher/lasso digest to 8da6f11 2024-08-10 04:55:47 +00:00
Eric Promislow
d5305606ba
Merge pull request #255 from ericpromislow/point-renovate-to-main-on-main
Have renovate update against branch 'main'.
2024-08-09 15:19:38 -07:00
Eric Promislow
a1f7487b51 Have renovate update against branch 'main'. 2024-08-07 10:10:28 -07:00
Michael Bolot
1d42891f81
Merge pull request #253 from MbolotSuse/schema-less
Handle Schema-less CRDs
2024-08-05 14:43:53 -05:00