@@ -736,15 +736,15 @@ func ensureSSHServerIsRunning(ctx context.Context, client *databricks.WorkspaceC
736736// resolveServerlessSession handles auto-generation and reconnection for serverless sessions.
737737// It checks local state for existing sessions matching the workspace, accelerator, and user,
738738// probes them to see if they're still alive, and prompts the user to reconnect or create new.
739- func (opts * ClientOptions ) resolveServerlessSession (ctx context.Context , client * databricks.WorkspaceClient ) error {
739+ func (o * ClientOptions ) resolveServerlessSession (ctx context.Context , client * databricks.WorkspaceClient ) error {
740740 version := build .GetInfo ().Version
741741
742742 me , err := client .CurrentUser .Me (ctx )
743743 if err != nil {
744744 return fmt .Errorf ("failed to get current user: %w" , err )
745745 }
746746
747- matching , err := sessions .FindMatching (ctx , client .Config .Host , opts .Accelerator , me .UserName )
747+ matching , err := sessions .FindMatching (ctx , client .Config .Host , o .Accelerator , me .UserName )
748748 if err != nil {
749749 log .Warnf (ctx , "Failed to load session state: %v" , err )
750750 }
@@ -757,7 +757,7 @@ func (opts *ClientOptions) resolveServerlessSession(ctx context.Context, client
757757
758758 var alive []sessions.Session
759759 for _ , s := range matching {
760- _ , _ , _ , probeErr := getServerMetadata (ctx , client , s .Name , s .ClusterID , version , opts .Liteswap )
760+ _ , _ , _ , probeErr := getServerMetadata (ctx , client , s .Name , s .ClusterID , version , o .Liteswap )
761761 if probeErr == nil {
762762 alive = append (alive , s )
763763 } else if errors .Is (probeErr , errServerMetadata ) {
@@ -783,16 +783,16 @@ func (opts *ClientOptions) resolveServerlessSession(ctx context.Context, client
783783
784784 for i , s := range alive {
785785 if choice == choices [i ] {
786- opts .ConnectionName = s .Name
786+ o .ConnectionName = s .Name
787787 cmdio .LogString (ctx , "Reconnecting to session: " + s .Name )
788788 return nil
789789 }
790790 }
791791 }
792792
793793 // No alive session selected — generate a new name.
794- opts .ConnectionName = sessions .GenerateSessionName (opts .Accelerator , client .Config .Host )
795- cmdio .LogString (ctx , "Creating new session: " + opts .ConnectionName )
794+ o .ConnectionName = sessions .GenerateSessionName (o .Accelerator , client .Config .Host )
795+ cmdio .LogString (ctx , "Creating new session: " + o .ConnectionName )
796796 return nil
797797}
798798
0 commit comments