ssh setup: handle duplicate cluster names in the interactive cluster picker#5777
Open
sridhar-3009 wants to merge 1 commit into
Open
ssh setup: handle duplicate cluster names in the interactive cluster picker#5777sridhar-3009 wants to merge 1 commit into
sridhar-3009 wants to merge 1 commit into
Conversation
…picker The SSH setup cluster picker called ClusterDetailsClusterNameToClusterIdMap from the Databricks SDK to build a name→ID map for the interactive drop-down. That SDK method fails with "duplicate .ClusterName: <name>" whenever two or more clusters in the workspace share the same display name, which Databricks permits. Replace the SDK call with a direct ListAll call and a new buildClusterItems helper that constructs the picker list without any keying by name. When two clusters share a name, both entries are shown with " (<cluster-id>)" appended so the user can tell them apart. Unique names are displayed unchanged. Fixes databricks#974
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
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.
Problem
The SSH
setupcommand's interactive cluster picker called the SDK'sClusterDetailsClusterNameToClusterIdMap, which builds amap[string]stringkeyed by cluster display name. Databricks allows multiple clusters to share the
same name, so this call fails with:
The same underlying issue was originally reported against
auth login --configure-cluster(#974) — theauth loginpath was fixed by switching toAskForCluster(which usesListAlldirectly), but the SSH setup path wasleft using the broken SDK helper.
Fix
In
experimental/ssh/internal/setup/setup.go, replaced theClusterDetailsClusterNameToClusterIdMapcall withListAllplus a newbuildClusterItemshelper. The helper builds the picker list without anyname-based keying. When two or more clusters share a name, each entry gets
(<cluster-id>)appended so the user can distinguish them. Clusters withunique names are displayed without modification.
Tests
Added four unit tests for
buildClusterItemscovering:(id)appendedFixes #974