Initialize BRICKS_CLI_PATH and increase default OAuth timeout (#237)

related to https://github.com/databricks/databricks-sdk-go/pull/330
This commit is contained in:
Fabian Jakobs 2023-03-08 15:14:24 +00:00 committed by GitHub
parent 65b3f998ba
commit f0c35a2b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package config package config
import ( import (
"os"
"github.com/databricks/databricks-sdk-go" "github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/service/scim" "github.com/databricks/databricks-sdk-go/service/scim"
) )
@ -85,3 +87,7 @@ func (w *Workspace) Client() (*databricks.WorkspaceClient, error) {
return databricks.NewWorkspaceClient(&config) return databricks.NewWorkspaceClient(&config)
} }
func init() {
os.Setenv("BRICKS_CLI_PATH", os.Args[0])
}

View File

@ -30,7 +30,7 @@ const (
appRedirectAddr = "localhost:8020" appRedirectAddr = "localhost:8020"
// maximum amount of time to acquire listener on appRedirectAddr // maximum amount of time to acquire listener on appRedirectAddr
DefaultTimeout = 15 * time.Second DefaultTimeout = 45 * time.Second
) )
var ( // Databricks SDK API: `databricks OAuth is not` will be checked for presence var ( // Databricks SDK API: `databricks OAuth is not` will be checked for presence