1
0
mirror of https://github.com/rancher/steve.git synced 2025-07-15 15:42:13 +00:00
steve/pkg/sqlcache/informer
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
..
factory Hard-wire external associations: 5/7: update A=>B links when instances of A change (#646) 2025-07-03 14:35:09 -07:00
db_mocks_test.go Hard-wire external associations: 3 sections in, this one is 4/7 (#645) 2025-06-25 16:10:48 -07:00
dynamic_mocks_test.go Bumped dependencies to be compatible with k8s-v1.33 (#681) 2025-06-20 17:53:42 +05:30
indexer_test.go Split RegisterAfterUpsert into RegisterAfterAdd and RegisterAfterUpdate (#644) 2025-05-30 08:25:12 -04:00
indexer.go Add object to RegisterAfterDelete and introduce RegisterAfterDeleteAll (#649) 2025-06-03 17:32:43 -04:00
informer_mocks_test.go Bumped dependencies to be compatible with k8s-v1.33 (#681) 2025-06-20 17:53:42 +05:30
informer_test.go Hard-wire external associations: 5/7: update A=>B links when instances of A change (#646) 2025-07-03 14:35:09 -07:00
informer.go Hard-wire external associations: 5/7: update A=>B links when instances of A change (#646) 2025-07-03 14:35:09 -07:00
listoption_indexer_test.go Hard-wire external associations: 5/7: update A=>B links when instances of A change (#646) 2025-07-03 14:35:09 -07:00
listoption_indexer.go vai: Rework events garbage collection delete query (#682) 2025-06-26 09:22:40 -07:00
shared_informer_hack.go Move lasso SQL cache in Steve (#452) 2025-01-17 09:34:48 -05:00
shared_informer_test.go Move lasso SQL cache in Steve (#452) 2025-01-17 09:34:48 -05:00
sql_mocks_test.go Hard-wire external associations: 3 sections in, this one is 4/7 (#645) 2025-06-25 16:10:48 -07:00
synthetic_watcher_test.go support unwatchables in vai (#458) 2025-02-20 12:45:58 -08:00
synthetic_watcher.go support unwatchables in vai (#458) 2025-02-20 12:45:58 -08:00
transaction_mocks_test.go Bumped dependencies to be compatible with k8s-v1.33 (#681) 2025-06-20 17:53:42 +05:30