feat: introduce asynchronous nodepool creation in backend in a disabled state#5790
Conversation
|
/lgtm |
There was a problem hiding this comment.
Pull request overview
Introduces backend support for asynchronous node pool creation by adding a controller that can “adopt or create” a Cluster Service node pool and persist its ClusterServiceID onto the NodePool Cosmos document, while updating the node pool create operation controller to read the ClusterServiceID from the NodePool resource (rather than relying on the operation’s InternalID).
Changes:
- Add a NodePool → Cluster Service create/adoption controller that POSTs the node pool when missing and then writes the resulting ClusterServiceID back to Cosmos.
- Update the node pool create operation controller to drive operation status updates off the NodePool Cosmos document (listers + ClusterServiceID from the resource).
- Expand tests and adjust test fixtures to use the ARO-HCP node pool href format.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/pkg/controllers/operationcontrollers/utils.go | Removes legacy shared polling helper for node pool operations. |
| backend/pkg/controllers/operationcontrollers/test_helpers_test.go | Updates node pool internal ID fixture to ARO-HCP node pool href format. |
| backend/pkg/controllers/operationcontrollers/operation_node_pool_create.go | Switches to listers and NodePool-backed ClusterServiceID for status polling and operation updates. |
| backend/pkg/controllers/operationcontrollers/operation_node_pool_create_test.go | Updates/extends operation-node-pool-create unit tests for new reconciliation gating and lister usage. |
| backend/pkg/controllers/nodepoolcreationcontrollers/node_pool_cluster_service_create_controller.go | Adds controller to create/adopt CS node pools and persist ClusterServiceID onto NodePool Cosmos documents. |
| backend/pkg/controllers/nodepoolcreationcontrollers/node_pool_cluster_service_create_controller_test.go | Adds unit tests covering create/adopt flows and error propagation. |
| backend/pkg/app/backend.go | Wires the new controller into backend controller startup and updates controller construction dependencies. |
| var persistErr *arm.CloudErrorBody | ||
| if operationalState.provisioningState == arm.ProvisioningStateFailed { | ||
| persistErr = &arm.CloudErrorBody{ | ||
| Code: arm.CloudErrorCodeInvalidRequestContent, | ||
| Message: operationalState.message, | ||
| } | ||
| } |
7f84a38 to
c851f60
Compare
|
/lgtm |
|
/hold until we discuss the handling of the code to be returned in the operation. |
20868b4 to
b774f30
Compare
b774f30 to
240f08d
Compare
|
/lgtm |
| var persistErr *arm.CloudErrorBody | ||
| if operationalState.provisioningState == arm.ProvisioningStateFailed { | ||
| persistErr = &arm.CloudErrorBody{ | ||
| Code: arm.CloudErrorCodeInvalidRequestContent, | ||
| Message: operationalState.message, | ||
| } | ||
| } |
240f08d to
d27249c
Compare
|
/lgtm |
d27249c to
f387bbc
Compare
…ed state The backend logic to perform asynchronous nodepool creation is disabled for now: the added controller is only executed when ClusterServiceID is not set. For now in frontend we always store the ClusterServiceID so it is guaranteed to not be executed. Additionally, the nodepool create operation has been updated to retrieve the ClusterServiceID from the NodePool cosmos resource instead of the operation. This allows us to stop relying on it for when we stop setting it in frontend.
f387bbc to
fd620eb
Compare
|
/hold cancel |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, miguelsorianod 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 |
|
/retest |
Revert "Merge pull request #5790 from miguelsorianod/move-cs-nodepool-creation-to-backend-1
…depoolcreation-to-backend-1" This reverts commit 0666787, effectively reverting the revert.
The backend logic to perform asynchronous nodepool creation is disabled for now: the added controller is only executed when ClusterServiceID is not set. For now in frontend we always store the ClusterServiceID so it is guaranteed to not be executed.
Additionally, the nodepool create operation has been updated to retrieve the ClusterServiceID from the NodePool cosmos resource instead of the operation. This allows us to stop relying on it for when we stop setting it in frontend.