1
0
mirror of https://github.com/rancher/steve.git synced 2025-07-16 16:01:37 +00:00
Commit Graph

526 Commits

Author SHA1 Message Date
Silvio Moioli
c48ac64c4d
[v2.10] SQL cache backports (#435)
Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
2025-01-11 12:26:12 +01:00
Josh Meranda
a672f2f12a
add release workflow (#324)
Co-authored-by: joshmeranda <joshua.meranda@gmail.com>
2024-11-15 12:21:59 -05: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
Michael Bolot
dfae21cb39 Adding changes from code review 2024-08-05 12:34:59 -05:00
Eric Promislow
8ce0b83be7 Add unit tests for schemaless CRDs 2024-08-05 12:04:00 -05:00
Eric Promislow
72384a606d Handle schema-less CRDs 2024-08-05 12:03:53 -05:00
Alejandro Ruiz
435e220795 fix(accesscontrol): CacheKey could not be stable 2024-07-31 10:24:23 +02:00
Tom Lebreux
4787160614
Bump wrangler to v3.0.0 (#239)
and other dependencies that also bumps wrangler
2024-07-09 09:08:09 -04:00
Silvio Moioli
0841e03c57
sql: bugfix: return total resource count correctly (#236)
* sql: drop dead code

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

* sql: bugfix: return total resource count correctly

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

* adapt tests

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

* adapt mocks

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

* TEMP: remove this when bumping lasso to include https://github.com/rancher/lasso/pull/84

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

* Use latest lasso instead of fork

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
2024-07-05 16:17:16 -04:00
Silvio Moioli
88fd70abbd sql: drop dead code
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-07-05 16:08:56 +02:00
Silvio Moioli
cb311a8ce5 sql: remove spurious log line
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-07-05 10:19:07 +02:00
Michael Bolot
22a06dd14f
Merge pull request #230 from MbolotSuse/apigroups-fix
Adding APIGroups back to the schema
2024-07-03 08:25:54 -05:00
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
Tom Lebreux
9ac9be9c0e
Fix missing fields in schema definition endpoint (#215) 2024-06-17 10:52:19 -04:00