Skip to content

providers/gcp: generalize async op handling into GcloudCommand.IssueAsync#6803

Closed
ashishsuneja wants to merge 8 commits into
GoogleCloudPlatform:masterfrom
ashishsuneja:gcloud_async_refactor
Closed

providers/gcp: generalize async op handling into GcloudCommand.IssueAsync#6803
ashishsuneja wants to merge 8 commits into
GoogleCloudPlatform:masterfrom
ashishsuneja:gcloud_async_refactor

Conversation

@ashishsuneja

Copy link
Copy Markdown
Collaborator

Follow-up to PR #6747 per hubatish's review comments (#6747 (comment)... and the seconding comment below it).

Moves the --async issue + 'no op name printed, fall back to listing operations' pattern out of GKE-specific _IssueAsync into a reusable GcloudCommand.IssueAsync method on the shared GCP util class, with the resource-specific lookup (_GetLatestOperationName for GKE) passed in as an optional get_latest_op_fn callable.

Scope: Purely additive — GcloudCommand.Issue() itself is unchanged, so none of the 194 existing call sites across GCP providers are affected.

Tested:

  • All 4 GoogleKubernetesEngineAsyncOpsTestCase tests pass
  • Full tests/providers/gcp/ suite: 278/281 passed (3 failures are pre-existing test-isolation flakiness in gce_managed_instance_group_test.py/gcp_cluster_test.py, unrelated to this change — confirmed they fail identically without this patch applied)
  • pyink + lint-diffs clean

Ashish Suneja added 8 commits June 9, 2026 12:47
- _IssueAsync: issues gcloud --async commands, returns op name
- CreateNodePoolAsync: creates nodepool, returns op handle
- DeleteNodePoolAsync: deletes nodepool, returns op handle
- UpgradeNodePoolAsync: upgrades nodepool, returns op handle
- UpdateClusterAsync: toggles label for non-destructive update
- WaitForOperation: polls until DONE/ABORTING
- ResolveNodePoolVersions: auto-detects initial/target versions
- _GetLatestOperationName: fallback op lookup by type+target
- GetNodePoolNames: lists current node pools

Tested:
- Existing GKE test suite passing
- pyink + lint-diffs clean
…sync

Moves the --async issue + 'no op name printed, fall back to listing
operations' pattern out of GKE-specific _IssueAsync into a reusable
GcloudCommand.IssueAsync method, with the resource-specific lookup
(_GetLatestOperationName for GKE) passed in as a callable. Per
hubatish's review on PR GoogleCloudPlatform#6747.
@ashishsuneja

Copy link
Copy Markdown
Collaborator Author

Closing — folded these commits directly into #6747 per reviewer feedback, since the suggestion originated there. See #6747 for the IssueAsync refactor + tests.

@ashishsuneja ashishsuneja deleted the gcloud_async_refactor branch June 29, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant