Skip to content

Commit 9b49b14

Browse files
committed
fix auth profiles
1 parent ebf1ac0 commit 9b49b14

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

cmd/auth/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func setHostAndAccountId(ctx context.Context, cmd *cobra.Command, existingProfil
279279

280280
// If the account-id was not provided as a cmd line flag, try to read it from
281281
// the specified profile.
282-
isAccountHost := (&config.Config{Host: authArguments.Host, Experimental_IsUnifiedHost: authArguments.IsUnifiedHost}).GetHostType() != config.WorkspaceHost
282+
isAccountHost := (&config.Config{Host: authArguments.Host, Experimental_IsUnifiedHost: authArguments.IsUnifiedHost}).HostType() != config.WorkspaceHost
283283
accountID := authArguments.AccountID
284284
if isAccountHost && accountID == "" {
285285
if existingProfile != nil && existingProfile.AccountID != "" {

cmd/auth/profiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (c *profileMetadata) Load(ctx context.Context, configFilePath string, skipV
5151
return
5252
}
5353

54-
if cfg.GetHostType() != config.WorkspaceHost {
54+
if cfg.ConfigType() == config.AccountConfig {
5555
a, err := databricks.NewAccountClient((*databricks.Config)(cfg))
5656
if err != nil {
5757
return

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ require (
7575
google.golang.org/grpc v1.75.1 // indirect
7676
google.golang.org/protobuf v1.36.9 // indirect
7777
)
78+
79+
replace github.com/databricks/databricks-sdk-go => ../databricks-sdk-go

libs/auth/arguments.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ func (a AuthArguments) ToOAuthArgument() (u2m.OAuthArgument, error) {
2121
Experimental_IsUnifiedHost: a.IsUnifiedHost,
2222
}
2323
host := cfg.CanonicalHostName()
24-
if cfg.GetHostType() == config.AccountHost {
24+
if cfg.HostType() == config.AccountHost {
2525
return u2m.NewBasicAccountOAuthArgument(host, cfg.AccountID)
26-
} else if cfg.GetHostType() == config.UnifiedHost {
26+
} else if cfg.HostType() == config.UnifiedHost {
2727
return u2m.NewBasicUnifiedOAuthArgument(host, cfg.AccountID)
2828
}
2929
return u2m.NewBasicWorkspaceOAuthArgument(host)

0 commit comments

Comments
 (0)