Skip to content

feat: move and enable asynchronous CS update interactions - #6067

Closed
Miguel Soriano (miguelsorianod) wants to merge 3 commits into
Azure:mainfrom
miguelsorianod:remove-csupdatecalls-from-frontend
Closed

Miguel Soriano (miguelsorianod) wants to merge 3 commits into
Azure:mainfrom
miguelsorianod:remove-csupdatecalls-from-frontend

Conversation

@miguelsorianod

Copy link
Copy Markdown
Collaborator

This PR removes CS update interactions from frontend, which makes the update dispatch controllers in backend fully take ownership of interacting with CS.

Stop calling Cluster Service synchronously from the frontend on
cluster PUT/PATCH.

Cluster configuration changes are now persisted to Cosmos and propagated to CS by
the backend ClusterClusterServiceUpdateDispatch controller.

- Remove UpdateCluster and UpdateClusterAutoscaler calls from
  updateHCPClusterInCosmos. The frontend only writes the cluster document and
  creates the update operation.
- Create update operations with an empty internal ID instead of the CS cluster ID,
  since CS propagation is no longer tied to the frontend request path.
- Add syncClusterClusterServiceUpdateDispatch integration test step to invoke
  the dispatch syncer directly against the CS mock.
@miguelsorianod

Copy link
Copy Markdown
Collaborator Author

/hold until the phase1 of async updates (#6047) has been fully rolled out to production and it is stabilized

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 shifts Cluster Service (CS) update responsibility out of the frontend and into backend controller reconciliation (“update dispatch”), and updates integration test scaffolding/artifacts to exercise the new async update flow.

Changes:

  • Removed synchronous CS update calls from frontend update handlers (cluster, node pool, external auth), leaving Cosmos as the source of desired state and relying on backend controllers to propagate to CS.
  • Added an integration-test step to invoke the backend ClusterClusterServiceUpdateDispatch syncer in tests.
  • Updated integration artifacts (tenantId population, expected content, and version bumps) to align with the new controller-driven update behavior.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test-integration/utils/databasemutationhelpers/step_sync_cluster_cluster_service_update_dispatch.go New integration step to run the cluster→CS update-dispatch syncer once for a specific cluster key.
test-integration/utils/databasemutationhelpers/resource_crud_test_util.go Registers the new syncClusterClusterServiceUpdateDispatch step type.
test-integration/frontend/artifacts/FrontendCRUD/NodePool/experimental-features/00-httpCreate-subscription-with-afec/subscription.json Adds tenantId in subscription properties for test expectations.
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/07-clusterServiceCompare-update-cleared-flag/expected-content.json New expected output for a “cleared flag” comparison scenario.
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/06-syncClusterClusterServiceUpdateDispatch-propagate-replace-to-cs/00-key.json New key file used by the new sync step to target a cluster.
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/05-httpReplace-cluster/feature-flag-test.json Updates the test cluster version payload (4.19 → 4.20).
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/04-httpReplace-subscription-keep-afec/subscription.json Adds tenantId in subscription properties for test expectations.
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/01-httpCreate-cluster/feature-flag-test.json Updates the test cluster version payload (4.19 → 4.20).
test-integration/frontend/artifacts/FrontendCRUD/Cluster/experimental-features/00-httpCreate-subscription-with-afec/subscription.json Adds tenantId in subscription properties for test expectations.
frontend/pkg/frontend/node_pool.go Removes frontend-to-CS update calls during node pool update; persists desired state and creates an async operation.
frontend/pkg/frontend/external_auth.go Removes frontend-to-CS update calls during external auth update; persists desired state and creates an async operation.
frontend/pkg/frontend/cluster.go Removes frontend-to-CS update calls during cluster update; persists desired state and creates an async operation.

Comment on lines 577 to 581
return utils.TrackError(err)
}

// Temporary check until creation and update interaction with CS is moved to the backend: If an update arrives after the node pool
// has been created in Cosmos but before it exists in CS, or before its ClusterServiceID has been persisted in Cosmos, return an error.
if oldInternalNodePool.ServiceProviderProperties.ClusterServiceID == nil || len(oldInternalNodePool.ServiceProviderProperties.ClusterServiceID.String()) == 0 {
return utils.TrackError(fmt.Errorf("serviceProviderProperties.clusterServiceID is required to update a node pool"))
}

csNodePoolBuilder, err := ocm.BuildCSNodePool(ctx, newInternalNodePool, true)
if err != nil {
return utils.TrackError(err)
}
logger.Info(fmt.Sprintf("updating resource %s", oldInternalNodePool.ID))
_, err = f.clusterServiceClient.UpdateNodePool(ctx, *oldInternalNodePool.ServiceProviderProperties.ClusterServiceID, csNodePoolBuilder)
if err != nil {
return utils.TrackError(err)
}

Stop calling Cluster Service synchronously from the frontend on
node pool PUT/PATCH.

Node Pool configuration changes are now persisted to Cosmos and propagated to CS by
the backend NodePoolClusterServiceUpdateDispatch controller.

- Remove the UpdateNodePool call from updateNodePoolInCosmos. The frontend only
  writes the node pool document and creates the update operation.
- Create update operations with an empty internal ID instead of the CS node pool ID,
  since CS propagation is no longer tied to the frontend request path.
Stop calling Cluster Service synchronously from the frontend on
external auth PUT/PATCH.

External Auth configuration changes are now persisted to Cosmos and propagated to CS by
the backend ExternalAuthClusterServiceUpdateDispatch controller.

- Remove UpdateExternalAuth call from updateExternalAuthInCosmos. The frontend only
  writes the external auth document and creates the update operation.
- Create update operations with an empty internal ID instead of the CS external auth ID,
  since CS propagation is no longer tied to the frontend request path.
@miguelsorianod
Miguel Soriano (miguelsorianod) force-pushed the remove-csupdatecalls-from-frontend branch from a587782 to 3a3817e Compare July 14, 2026 11:39
Copilot AI review requested due to automatic review settings July 14, 2026 11:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.

@miguelsorianod

Copy link
Copy Markdown
Collaborator Author

/retest

@deads2k

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[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

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

@miguelsorianod

Copy link
Copy Markdown
Collaborator Author

/retest

1 similar comment
@miguelsorianod

Copy link
Copy Markdown
Collaborator Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

@miguelsorianod

Copy link
Copy Markdown
Collaborator Author

The same code has been merged in a unified PR with other changes, in #6121.

Closing this.

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.

3 participants