switchover: adopt CRN references + surface first_active/endpoint metadata (SDK #859) - #3454
Draft
Namrata Gaur (ngaur99) wants to merge 5 commits into
Draft
switchover: adopt CRN references + surface first_active/endpoint metadata (SDK #859)#3454Namrata Gaur (ngaur99) wants to merge 5 commits into
Namrata Gaur (ngaur99) wants to merge 5 commits into
Conversation
Bumps the switchover SDK to the api#2669 regeneration (ccloud-sdk-go-v2-internal#859) and adopts the field renames + new fields it brings: - CRN references (api #252/#2545): member_id/environment/parent_resource_id/ network_id/access_point become member_crn, environment_crn, parent_resource_crn, network_crn, access_point_crn. Create/failover commands assemble the CRNs from the current organization plus the flag-supplied IDs, so the flag surface stays ID-based. - New response metadata (api #2669): first_active on `pair describe` (human "First Active" row; already carried verbatim in -o json/yaml), and cloud/region/connection_type appended to each endpoint side in `endpoint describe`. SDK pinned by pseudo-version (no local replace directive). make build clean; verified `pair describe` renders First Active against a live READY pair on devel. (SKIP=go-generate: the repo's mock-regen pre-commit hook fails on clean HEAD in this environment -- travisjeffery/mocker cannot load packages under this Go toolchain, unrelated to this change. All other hooks ran.) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
❌ Error getting contributor login(s). |
…=...) The `--member` flag took `id=<cluster-id>` and the CLI assembled member_crn from the current org + the pair's --environment. That silently assumed every member lives in the pair's environment, so it could not express a pair whose two members are in different environments -- which the backend explicitly supports, because member_crn carries its own environment (ORC-10263). Change --member to take `crn=<member-crn>` directly and pass it through unchanged. The CRN carries the member's own organization and environment, so cross-environment members work. The pair's own environment_crn is still built from --environment (which also drives the ?environment= query parameter). before: --member name=west,id=lkc-111111 after: --member name=west,crn=crn://confluent.cloud/organization=.../environment=env-.../cloud-cluster=lkc-111111 Verified against devel: `id=` is now rejected with a clear error; `crn=` creates the pair with member_crn passed through verbatim. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CreateSwitchoverEndpointSpec accepts only display_name, parent_resource_crn,
target, and endpoints -- not environment_crn (the endpoint's environment travels
inside the parent pair's CRN). The CLI was setting spec.environment_crn, so every
`endpoint create` failed with:
Bad Request: unknown field "environment_crn"
Build parent_resource_crn directly from the org + --environment + --switchover-pair
and drop environment_crn from the request body. Found by running `endpoint create`
against devel.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The --endpoint network= value was passed straight into network_crn, so the CLI put a bare network ID (e.g. "n-abc123") where the backend requires a full CRN (crn://confluent.cloud/organization=.../environment=.../network=<id>) -- the request would fail the network_crn pattern. Assemble the network_crn in create() from the current organization + the endpoint's --environment + the given network id, matching how --member and parent_resource are handled. access-point is left as a full-CRN passthrough: its canonical form carries a gateway segment (.../gateway=<gw>/access-point=<id>) that a plain access-point ID does not supply, so it cannot be assembled from an id alone. The flag help now says network=<network-id> (assembled) vs access-point=<access-point-crn> (full). Verified against devel: network=n-abc123 is sent as crn://confluent.cloud/organization=.../environment=env-devc7mdr2w/network=n-abc123 and the backend accepts the CRN format (failing later on resolution, not format). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…K sync) - trigger-switch --failover-type default CLEAN -> PLANNED; help text updated to PLANNED, UNPLANNED, or RESTORE (RESTORE unchanged), per api#2669. - Bump switchover SDK pin to pick up the updated phases/failover-type spec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on Ethan Wang (@wyuzheng)'s #3399 (
switchover-cli-local-demo) — base is that branch, so the diff is only the commits below.Summary
Brings the
switchovercommands current with ccloud-sdk-go-v2-internal#859 (regenerated from api#2669), and makes the CRN-reference handling correct and consistent across the flag surface.Commits
member_crn,environment_crn,parent_resource_crn,network_crn,access_point_crn; andpair describenow showsfirst_active(a First Active row) pluscloud/region/connection_typeper endpoint side.--member crn=…— take the member CRN directly instead of assembling it fromid=+ the pair's--environment. The CRN carries the member's own environment, so the two members may live in different environments (which the backend supports; the oldid=assembly could not express it).environment_crn—CreateSwitchoverEndpointSpecdoesn't accept it (the environment travels insideparent_resource_crn); the CLI was setting it, so everyendpoint createfailed withunknown field "environment_crn".network_crnfromnetwork=<id>— the value was passed raw, putting a bare network ID where the backend requires a full CRN. Now assembled from org +--environment+ id.access-pointstays a full-CRN passthrough (its canonical form carries agateway=segment an id can't supply).Testing (live devel)
pair create(both--member crn=andid=earlier) → READY;list,describe(human/json/yaml),update,deleteall verified; 404 and the READY-onlyupdateguard rail return clean errors.trigger-switch→ correctPOST …/{id}:failoverrequest; backend guard fires (409: has no switchover endpoints) — command validated.endpoint create→ sends a well-formed request; blocked only by an endpoint-service resolution ambiguity (a network that resolves to multiple endpoints), not by the CLI.Dependency & notes
replace. Re-pin to the SDK release tag once [CLI-953] call parse flags into context from api key prerunner #859 merges. Draft until the api#2669 → chore: update repo by service bot #2545 stack lands.SKIP=go-generatewas used on commits: the repo's mock-regen pre-commit hook fails on clean HEAD in this environment (travisjeffery/mockercan't load packages under this Go toolchain), unrelated to this change. All other hooks pass. Pushed viagit push-external.🤖 Generated with Claude Code