Skip to content

add genericdocument compatible serialization of nodepools#5206

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
cs-172-nodepool-compatible
May 13, 2026
Merged

add genericdocument compatible serialization of nodepools#5206
openshift-merge-bot[bot] merged 1 commit into
mainfrom
cs-172-nodepool-compatible

Conversation

@deads2k
Copy link
Copy Markdown
Collaborator

@deads2k deads2k commented May 11, 2026

This stores all the data necessary to switch from custom cluster storage to the generic document storage for nodepools.

Part of a multi-step plan

  1. add genericdocument compatible serialization of nodepools #5206
  2. read new fields for nodepool storage #5207
  3. stop serializing old nodepool fields #5208
  4. switch to using generic storage for nodepools #5209

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 updates NodePool Cosmos DB persistence to support a migration from the current custom Cosmos document shape to a GenericDocument[api.HCPOpenShiftClusterNodePool]-compatible shape by inlining the internal API NodePool object into the stored document, while retaining legacy fields for backward compatibility.

Changes:

  • Inline api.HCPOpenShiftClusterNodePool into the stored NodePool document properties to make the document shape compatible with GenericDocument.
  • Update NodePool conversion logic to populate the new inlined field and adjust ETag propagation to avoid selector ambiguity introduced by embedding.
  • Refresh integration-test Cosmos fixture JSON to include the newly persisted fields (id/name/type/systemData/provisioningState/serviceProviderProperties/etc).

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 22 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 Updates expected Cosmos NodePool document to include inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/nodepool-02.json Updates expected Cosmos NodePool document to include inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-node-pool-02.json Updates “old data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/nodepool-basic-node-pool.json Updates “old data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-node-pool-02.json Updates “create current” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/nodepool-basic-node-pool.json Updates “create current” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-node-pool-02.json Updates migration “read new data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/nodepool-basic-node-pool.json Updates migration “read new data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-node-pool-02.json Updates migration fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/nodepool-basic-node-pool.json Updates migration fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-node-pool-02.json Updates migration “confirm migration” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/nodepool-basic-node-pool.json Updates migration “confirm migration” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-node-pool-02.json Updates migration “load old data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/nodepool-basic-node-pool.json Updates migration “load old data” fixture to include new inlined NodePool fields.
test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/nodepool-test-nodepool.json Updates expected Cosmos NodePool document for delete scenario to include inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/nodepool-basic.json Updates backend mismatch fixture to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/nodepool-basic.json Updates backend mismatch fixture end-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/nodepool-basic.json Updates backend mismatch fixture initial-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/nodepool-basic.json Updates backend mismatch fixture end-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/nodepool-basic.json Updates backend mismatch fixture initial-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/nodepool-basic.json Updates backend mismatch fixture end-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/nodepool-basic.json Updates backend mismatch fixture initial-state to include new inlined NodePool fields.
test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/nodepool-basic.json Updates backend mismatch fixture to include new inlined NodePool fields.
internal/database/types_nodepool.go Embeds api.HCPOpenShiftClusterNodePool into NodePool document properties for GenericDocument compatibility.
internal/database/convert_nodepool.go Populates the new embedded field and updates ETag mapping to avoid ambiguity from embedding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 11, 2026

We're not fiddling with unverifed fields in a serialization we're three commits from removing.

@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 11, 2026

/retest

@stevekuznetsov
Copy link
Copy Markdown
Contributor

/lgtm


// some pieces of data in the internalNodePool conflict with ResourceDocument fields. We may evolve over time, but for
// now avoid persisting those.
cosmosObj.InternalState.InternalAPI.TrackedResource = arm.TrackedResource{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we removing this?

// which is where we want to end up.
// * to be compatible with prior versions, we must continue writing all previous fields and this new field
// * to be compatible with prior versions, we must continue reading only from previous fields
api.HCPOpenShiftClusterNodePool `json:",inline"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there some reason it's a value and not a pointer?

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@deads2k deads2k force-pushed the cs-172-nodepool-compatible branch from b1fbee1 to 4fdd053 Compare May 12, 2026 14:59
@deads2k deads2k added the lgtm label May 12, 2026
@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 12, 2026

simple rebase. reapplying lgtm

@github-actions github-actions Bot removed the lgtm label May 12, 2026
@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 12, 2026

/retest

@deads2k
Copy link
Copy Markdown
Collaborator Author

deads2k commented May 12, 2026

/label lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 12, 2026

@deads2k: The label(s) /label lgtm cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, ux-approved, no-qe, rebase/manual, cluster-config-api-changed, run-integration-tests, verified, ready-for-human-review, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/skip-dependent-bug-check, jira/valid-bug, ok-to-test, stability-fix-approved, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/label lgtm

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.

@stevekuznetsov
Copy link
Copy Markdown
Contributor

/lgtm

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

openshift-ci Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, stevekuznetsov

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:
  • OWNERS [deads2k,stevekuznetsov]

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

@openshift-merge-bot openshift-merge-bot Bot merged commit 6c7c554 into main May 13, 2026
17 checks passed
@openshift-merge-bot openshift-merge-bot Bot deleted the cs-172-nodepool-compatible branch May 13, 2026 04:29
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.

4 participants