Skip to content

Switch clusters, nodepools, and externalauth to generic storage.#5395

Open
deads2k wants to merge 6 commits into
Azure:mainfrom
deads2k:cs-183-finalize-migration
Open

Switch clusters, nodepools, and externalauth to generic storage.#5395
deads2k wants to merge 6 commits into
Azure:mainfrom
deads2k:cs-183-finalize-migration

Conversation

@deads2k
Copy link
Copy Markdown
Collaborator

@deads2k deads2k commented May 26, 2026

Copilot AI review requested due to automatic review settings May 26, 2026 17:27
@openshift-ci openshift-ci Bot requested review from bennerv and mbarnes May 26, 2026 17:28
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 26, 2026

/hold for prod rollout

all were already lgtmed, this just combined them

/label lgtm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] and CosmosGenericToInternal.
  • Add defaulting on the generic read path (CosmosGenericToInternal) via an EnsureDefaults() 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.

deads2k and others added 6 commits May 29, 2026 12:06
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>
@deads2k deads2k force-pushed the cs-183-finalize-migration branch from 3e8e183 to 06090d5 Compare May 29, 2026 17:56
@openshift-ci openshift-ci Bot removed the lgtm label May 29, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 29, 2026

New changes are detected. LGTM label has been removed.

@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 29, 2026

/label lgtm

@openshift-ci openshift-ci Bot added the lgtm label May 29, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 29, 2026

@deads2k: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-parallel 06090d5 link true /test e2e-parallel

Full PR test history. Your PR dashboard.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants