1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-13 13:59:40 +00:00
Commit Graph

669 Commits

Author SHA1 Message Date
Eric Promislow
3119b3d8fa Ensure database is reset after an api-service change. (#785) v0.7.9 2025-08-18 15:07:49 -07:00
renovate-rancher[bot]
8608905a6a chore(deps): update module github.com/rancher/apiserver to v0.7.2 (#781)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
v0.7.8
2025-08-14 17:44:30 -04:00
Chad Roberts
89c4d78ebc Bump apiserver to v0.7.1 (#780) v0.7.7 2025-08-14 15:39:59 -04:00
renovate-rancher[bot]
5e38823e77 chore(deps): update module github.com/rancher/wrangler/v3 to v3.2.3-rc.3 (#771)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-08-11 10:15:44 -04:00
Eric Promislow
4cc7e7b947 Fix new projectsornamespaces negative tests. (#769)
Remember to select objects that don't have the project label assigned to them
when doing a negative test.
v0.7.6
2025-08-08 17:23:56 -07:00
Felipe Gehrke
3cac88141b #50968 - Single SQL Transaction for projectsornamespaces filter (#758)
* working for positive case

* changed to custom code

* removed comment

* added tests

* fixing ci error

* one more fix

* Update proxy_store tests for projectornamespace parsing.

Since we no longer need to execute a db query, and just return a filter,
we can drop a lot of code.

* added distinct back to conform with other queries

* one more fix

---------

Co-authored-by: Eric Promislow <epromislow@suse.com>
v0.7.5
2025-08-08 16:07:54 -03:00
Eric Promislow
dbd2818d22 VAI: Replace namespace+name default sort with id (#724)
* Sort by ID rather than metadata.namespace,metadata.name

- In tests add an id field to the list of fields to cache/create and to the objects.

* Add benchmark tests to compare sorting by ns/name vs id.
v0.7.4
2025-08-07 15:42:33 -07:00
Eric Promislow
97b595d551 Implement sorting by status.lastScheduleTime and status.lastSuccessfulTime. (#766)
Note that it will be possible to filter against these fields, but that doesn't sound too useful,
as you'd have to compare against a date string.
2025-08-07 13:28:30 -07:00
Chad Roberts
c81c0d21a4 Dropping debug-level default to 1 to reduce noise from reflector. (#765) 2025-08-07 14:39:13 -04:00
Chad Roberts
ac12e33508 Update to use klog v2. Also turned down the default debug-level to 2 from 7 to avoid the lower level http logs that show up with klog v2 (#764) v0.7.3 2025-08-07 10:40:36 -07: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
Tom Lebreux
a020084518 Fix slow labels queries (#762)
* Add PRAGMA temp_store=2 to write temporary tables in memory

* Only use DISTINCT when filtering labels

* Log long queries to debug

* Add unit test
v0.7.2
2025-08-06 20:07:09 -04: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.
v0.7.1
2025-07-31 10:43:55 -07:00
Chad Roberts
e92b9cf7ea Revert "Update to use klog v2 (#744)" (#757)
This reverts commit dd64c2d200.
2025-07-30 13:19:25 -04:00
renovate-rancher[bot]
4bf9fcc6ca chore(deps): update module modernc.org/sqlite to v1.38.2 (#753)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-30 11:38:53 -04:00
Chad Roberts
dd64c2d200 Update to use klog v2 (#744) 2025-07-29 15:42:25 -04:00
Silvio Moioli
9fd14ce23a README: expand a bit on Watch API (#746) 2025-07-29 10:04:26 +02:00
renovate-rancher[bot]
a344ad448f chore(deps): update module modernc.org/sqlite to v1.38.1 (#747)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-28 13:12:24 -04:00
Tom Lebreux
a368cc241a Update branching version (#734)
* Update branching for new version

* Bump apiserver and norman to v0.7.0
v0.7.0
2025-07-21 10:21:53 -04:00
Sakala Venkata Krishna Rohit
1c7948d4c9 Revert "Revert "Make view link related to GET RBAC permission. (#699)" (#703)" (#704)
This reverts commit 8cd7bd0a8f.
2025-07-18 15:36:53 -07:00
Felipe Gehrke
b556256ed3 #50914 - Changed ParseQuery projectornamespace Handling (#718)
* changed ParseQuery projectornamespace handling

* addressed comments from eric/chad and tom

* fixing lint error

* added resourceVersion to list

* updated mocks

* updated tests

* Update tests after rebase

---------

Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
v0.6.29
2025-07-17 13:51:13 -04:00
Tom Lebreux
0c2c554c8c Respect shouldEncrypt configuration when storing events (#725) v0.6.28 2025-07-15 09:57:28 -04:00
Eric Promislow
904e52dc11 Index fields used for testing/QA to stay compatible with v2.11 (#719) v0.6.27 2025-07-11 10:32:32 -07:00
Tom Lebreux
faa5ad63e9 Fix CRD Created At field (#723)
* Add Tokens and Kubeconfig fields to date mapping

* Fix missing cols in transform func for watch

* Mark CRDs as.. CRD

* Don't transform CRD's date field
v0.6.26
2025-07-11 13:28:52 -04: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
v0.6.25
2025-07-11 12:48:19 -04:00
Eric Promislow
3692666375 Index the secrets annotation "management.cattle.io/project-scoped-secret-copy" (#706)
Tests will be in the rancher integration tests.
v0.6.24
2025-07-09 13:13:53 -07:00
Eric Promislow
76477e98df Hard-wire external associations: 6 and 7/7: unit tests for updating A=>B links when instances of A and B change (#702)
* Implement hard-wired external associations:

* The table is in sqlproxy.proxy_store
  - externalGVKDependencies - a map of GVKs to dependencies.
    When the key GVK is updated, it triggers the updates in the database for the dependent GVKs,
    replacing fields as specified in the table.

* This is done in an afterUpsert handler, but it's done after the transaction for the core
  GVK update is finished, because most likely the dependent GVK updates will depend on the
  final database values for the GVK being updated, and if we do it as part of the transaction
  the new values won't be committed to the database.

* Wrote unit tests for external associations.

* When an object is modified/created, check for external deps that need updating.

* Stop emitting errors when joining tables if one of the tables doesn't exist.

* Finish rebasing manually.

* Fix external association unit-tests after rebasing.
2025-07-09 13:11:42 -07:00
renovate-rancher[bot]
883d2f805a chore(deps): update module github.com/rancher/wrangler/v3 to v3.2.2 (#710)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-09 14:50:04 -04:00
Eric Promislow
a3cd651c75 Revert part of steve PR 633 (#708)
Specifically, recomment a test that was uncommented in this PR,
and revert the underlying code that made this test pass.  That
code change causes user-based integration tests to fail, so something
is not correct in that code.

This was actually unrelated to the reason for PR 633, to fix
a problem when sorting on a label that dropped objects that
didn't have that label.  That part remains untouched.
v0.6.23
2025-07-09 11:12:47 -07:00
Eric Promislow
2a86733c64 Use SQL WITH statements to sort unbound labels. (#663)
* Use SQL `WITH` statements to sort unbound labels.

These are labels whose names are never positively referenced in a filter,
so they don't need to exist on the row that we still want to display.

Here I create a virtual table of all the rows, substituting a null
value for each label that isn't associated on the row, and then sort on that.

* Just always select-distinct for now.

* Add more tests for filtering/sorting

- Assign more values to the cattle and horses labels
- Move the sortfield value to a number in the 100s -- keep in mind
  these values are sorted by ascii value of underlying chars, not numerically
- Rename the var names to better reflect the values they contain

* Remove mentions of the prepared SQL statement in the test descriptions.

We care either about the items we get back from the query, or in some
cases the SQL that gets generated by the AST interpreter.

* Simplify the use of WITH stmts in SQL (thx Tom)

* Fix the comment about an unexpected situation.

* Fix post-rebase tests.
v0.6.22
2025-07-08 10:07:05 -07:00
renovate-rancher[bot]
7aea36c8bd chore(deps): update module modernc.org/sqlite to v1.38.0 (#551)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-04 16:37:31 -07:00
renovate-rancher[bot]
b483d62b28 chore(deps): update github actions (#544)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-04 15:45:41 -07:00
renovate-rancher[bot]
d7ebf18596 chore(deps): update module golang.org/x/sync to v0.15.0 (#534)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-04 15:39:30 -07:00
renovate-rancher[bot]
e143845323 chore(deps): update module github.com/urfave/cli/v2 to v2.27.7 (#533)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-04 15:38:03 -07:00
renovate-rancher[bot]
8e9406302d chore(deps): update dependency go to v1.24.4 (#517)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-07-04 15:22:11 -07:00
Sakala Venkata Krishna Rohit
8cd7bd0a8f Revert "Make view link related to GET RBAC permission. (#699)" (#703)
This reverts commit 542c471584.
2025-07-04 14:27:43 -07:00
Sakala Venkata Krishna Rohit
542c471584 Make view link related to GET RBAC permission. (#699)
* Add view link based on GET RBAC permission

* Add tests for view link
2025-07-04 14:06:24 -07:00
Eric Promislow
3be82a28d1 Hard-wire external associations: 5/7: update A=>B links when instances of A change (#646)
* Continue rebasing.

* Wrote unit tests for external associations.

* Fix the generated SQL.

Some syntactic sugar (capitalizing the keywords), but use the 'ON' syntax on JOINs.

* We want "management.cattle.io.projects:spec.displayName" not "...spec.clusterName"

* Implement hard-wired external associations:

* The table is in sqlproxy.proxy_store
  - externalGVKDependencies - a map of GVKs to dependencies.
    When the key GVK is updated, it triggers the updates in the database for the dependent GVKs,
    replacing fields as specified in the table.

* This is done in an afterUpsert handler, but it's done after the transaction for the core
  GVK update is finished, because most likely the dependent GVK updates will depend on the
  final database values for the GVK being updated, and if we do it as part of the transaction
  the new values won't be committed to the database.

* When an object is modified/created, check for external deps that need updating.

* Stop emitting errors when joining tables if one of the tables doesn't exist.

* Update unit test syntax for SQL queries.

* And an override check

This ensures we don't overwrite good data when
pulling data from one table to another.

* Drop labels, and use mgmt.cattle.io/spec.displayName

There's no need to hardwire labels in proxy_store:typeSpecificIndexedFields
because all labels are indexed in the shadow labels table.

* Keep clusterName, add displayName for mgmt.cattle.io

* Fix rebase/merge breakage.

* Finish the merge: add the 'selfUpdateInfo' param where it didn't get inserted during merge.

* Patch up rebase failures.

* Now gomock generates named args. I give up.
2025-07-03 14:35:09 -07:00
Alejandro Ruiz
61173104af Fix parsing of metadata.fields when age is already a duration (#700)
* Fix parsing of metadata.fields when age is already a duration

* Fix frozen "now"

* Use ParseTimestampOrHumanReadableDuration instead
v0.6.21
2025-07-01 13:53:51 -03:00
Eric Promislow
c782fea615 Update the READMEs to cover SQL-based caching. (#693) 2025-06-26 09:29:51 -07:00
Peter Matseykanets
952305e096 vai: Rework events garbage collection delete query (#682) 2025-06-26 09:22:40 -07:00
Alejandro Ruiz
6495e7879c Make waiting for ExtensionAPIServer configurable (#694) v0.6.20 2025-06-26 17:04:49 +02:00
renovate-rancher[bot]
3086ba4bd0 chore(deps): update module github.com/rancher/remotedialer to v0.4.5-rc.3 (#674)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
v0.6.19
2025-06-26 06:57:32 -04:00
Eric Promislow
496a6f8968 Hard-wire external associations: 3 sections in, this one is 4/7 (#645)
* Continue rebasing.

* Wrote unit tests for external associations.

* Fix the generated SQL.

Some syntactic sugar (capitalizing the keywords), but use the 'ON' syntax on JOINs.

* whitespace fix post rebase

* We want "management.cattle.io.projects:spec.displayName" not "...spec.clusterName"

* Fix the database calls: drop the key

* Fix breakage during automatic rebase merging gone wrong.

* ws fix - NFC

* Post rebase-merge fixes

* Fix rebase-driven merge.

* Fix rebase breakage.

* go-uber v0.5.2 prefers real arg names to '<argN>'
2025-06-25 16:10:48 -07:00
renovate-rancher[bot]
ad064a8f8a chore(deps): update registry.suse.com/bci/bci-micro docker tag to v15.7 (#685)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-06-25 07:29:33 -04:00
renovate-rancher[bot]
94228c486d chore(deps): update module github.com/rancher/dynamiclistener to v0.7.0 (#690)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-06-25 07:25:58 -04:00
renovate-rancher[bot]
17511791e1 chore(deps): update module github.com/rancher/wrangler/v3 to v3.2.2-rc.3 (#692)
Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
2025-06-24 09:08:15 -04:00
Swastik Gour
e17ca28461 Bumped dependencies to be compatible with k8s-v1.33 (#681)
Signed-off-by: swastik959 <Sswastik959@gmail.com>
v0.6.18
2025-06-20 17:53:42 +05:30
Eric Promislow
c32995dba4 Log and ignore transform errors. (#683) v0.6.17 2025-06-18 11:02:46 -07:00
Felipe Gehrke
4212386e13 changing ParseHumanDuration to support timestamp values too (#684) 2025-06-18 10:57:49 -07:00