Switch clusters, nodepools, and externalauth to generic storage.#5395
Switch clusters, nodepools, and externalauth to generic storage.#5395deads2k wants to merge 6 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold for prod rollout all were already lgtmed, this just combined them /label lgtm |
There was a problem hiding this comment.
Pull request overview
This PR completes the migration of clusters, nodepools, and externalAuths to the shared database.GenericDocument[T] Cosmos storage shape, removing the legacy intermediateResourceDoc / internalState compatibility fields and deleting the old bespoke Cosmos document types + converters.
Changes:
- Switch cluster/nodepool/externalAuth CRUD, listers, and transaction decoding to use
database.GenericDocument[T]andCosmosGenericToInternal. - Add defaulting on the generic read path (
CosmosGenericToInternal) via anEnsureDefaults()interface hook. - Update integration test Cosmos artifacts to reflect the new stored document shape (remove legacy compatibility fields).
Reviewed changes
Copilot reviewed 120 out of 120 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/cluster-deleting/02-loadCosmos-cluster/cosmos-01-cluster.json | Removes legacy intermediateResourceDoc/internalState from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/cluster-creating/02-loadCosmos-cluster/cosmos-01-cluster.json | Removes legacy intermediateResourceDoc/internalState from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from expected post-migration Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from expected post-migration Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from expected post-migration Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/externalauth-default.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/cluster-deleting/02-loadCosmos-cluster/cosmos-01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/cluster-creating/02-loadCosmos-cluster/cosmos-01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/read-old-data/01-load-old-data/create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from seeded old-data Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/cluster-test-cluster.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-cluster-operation/03-cosmosCompare-final-state/cluster-test-cluster.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/create-current/02-cosmosCompare-confirm-content/cluster-create-with-tags.json | Removes legacy intermediateResourceDoc/internalState from expected Cosmos content. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/revoke/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/revoke-provisioning-conflict/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc/internalState from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/revoke-forbidden-afec-pending/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/revoke-forbidden-afec-missing/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/request/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/request-provisioning-conflict/01-load-initial-cosmos-state/01-cluster.json | Removes legacy intermediateResourceDoc from seeded Cosmos doc. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/12-untypedList-resourcegroup/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/10-untypedList-resourcegroup/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/09-untypedList-immutability-cluster/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/08-untypedListRecursive-immutability-cluster/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/basic-external-auth-auth.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/basic-external-auth-auth.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/basic-external-auth-auth.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/02-untypedListRecursive-immutability/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/immutability-np.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/create-with-tags-cluster.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/basic-external-auth-auth.json | Updates untyped listing fixtures to new generic stored shape (remove internalState). |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/externalauth-default.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/externalauth-default.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/externalauth-default.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/externalauth-default.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/externalauth-default.json | Updates backend mismatch test fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/controller_under_missing_nodepool_deleted/99-cosmosCompare-end-state/cluster.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/controller_under_missing_nodepool_deleted/00-load-initial-state/cluster.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/cluster.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/cluster.json | Updates orphan cleanup fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json | Updates backend mismatch fixtures to new generic stored shape. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/externalauth-default.json | Updates backend mismatch fixtures to new generic stored shape. |
| test-integration/backend/controllers/do_nothing/artifacts/sync_cluster/00-load-initial-state/cluster.json | Updates “do nothing” controller fixtures to new generic stored shape. |
| test-integration/admin/artifacts/AdminCRUD/HCP/lowercase-middleware/00-load-initial-cosmos-state/01-cluster.json | Updates admin integration fixtures to new generic stored shape. |
| test-integration/admin/artifacts/AdminCRUD/HCP/hello-world/00-load-initial-cosmos-state/01-cluster.json | Updates admin integration fixtures to new generic stored shape. |
| test-integration/admin/artifacts/AdminCRUD/HCP/cosmosdump/00-load-initial-cosmos-state/01-cluster.json | Updates admin integration fixtures to new generic stored shape. |
| test-integration/admin/artifacts/AdminCRUD/HCP/breakglass/00-load-initial-cosmos-state/01-cluster.json | Updates admin integration fixtures to new generic stored shape. |
| internal/databasetesting/mock_resources_global_lister.go | Updates mock global listers to list clusters/nodepools/externalAuths as GenericDocument[T]. |
| internal/databasetesting/mock_resources_db_client.go | Updates mock transaction result decoding to unmarshal GenericDocument[T] and use CosmosGenericToInternal. |
| internal/databasetesting/mock_resources_crud.go | Updates mock CRUD generics to use GenericDocument[T] for clusters/nodepools/externalAuths. |
| internal/database/types_nodepool.go | Deletes legacy nodepool Cosmos wrapper type (superseded by GenericDocument). |
| internal/database/types_hcpcluster.go | Deletes legacy cluster Cosmos wrapper type (superseded by GenericDocument). |
| internal/database/types_externalauth.go | Deletes legacy externalAuth Cosmos wrapper type (superseded by GenericDocument). |
| internal/database/transaction.go | Switches transactional batch decode for clusters/nodepools/externalAuths to GenericDocument[T]. |
| internal/database/global_lister.go | Switches global listers for clusters/nodepools/externalAuths to GenericDocument[T]. |
| internal/database/crud_nested_resource.go | Updates compile-time interface assertion to the GenericDocument nodepool shape. |
| internal/database/crud_hcpcluster.go | Switches cluster/nodepool/externalAuth nested CRUD to GenericDocument[T]. |
| internal/database/convert_nodepool.go | Deletes legacy nodepool conversion helpers (replaced by generic converter). |
| internal/database/convert_externalauth.go | Deletes legacy externalAuth conversion helpers (replaced by generic converter). |
| internal/database/convert_cluster.go | Deletes legacy cluster conversion helpers (replaced by generic converter). |
| internal/database/convert_generic.go | Adds defaulting hook (EnsureDefaults) to the generic Cosmos->internal conversion path. |
| internal/database/convert_any.go | Removes special-case cluster/nodepool/externalAuth conversions; relies on generic document conversion. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3e8e183 to
06090d5
Compare
|
New changes are detected. LGTM label has been removed. |
|
/label lgtm |
|
@deads2k: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
replaces
It is ready to merge once we get the next level into production (current stage already has prereq)