From 88b6dc8e16a366dc2da91e3368f88ef9ca3d7da1 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 3 Mar 2025 19:31:41 +0100 Subject: [PATCH] use $CLI instead of databricks --- .../exec/databricks-cli/profile-is-passed/output.txt | 4 ++-- .../exec/databricks-cli/profile-is-passed/script | 4 ++-- .../exec/databricks-cli/target-is-passed/output.txt | 10 +++++----- .../bundle/exec/databricks-cli/target-is-passed/script | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/acceptance/bundle/exec/databricks-cli/profile-is-passed/output.txt b/acceptance/bundle/exec/databricks-cli/profile-is-passed/output.txt index d733dd024..06cdd1c44 100644 --- a/acceptance/bundle/exec/databricks-cli/profile-is-passed/output.txt +++ b/acceptance/bundle/exec/databricks-cli/profile-is-passed/output.txt @@ -1,11 +1,11 @@ ->>> [CLI] bundle exec -- databricks current-user me +>>> [CLI] bundle exec -- [CLI] current-user me { "id":"[USERID]", "userName":"[USERNAME]" } ->>> [CLI] bundle exec --profile myprofile -- databricks current-user me +>>> [CLI] bundle exec --profile myprofile -- [CLI] current-user me { "id":"[USERID]", "userName":"[USERNAME]" diff --git a/acceptance/bundle/exec/databricks-cli/profile-is-passed/script b/acceptance/bundle/exec/databricks-cli/profile-is-passed/script index ad9280c5a..33e07494c 100644 --- a/acceptance/bundle/exec/databricks-cli/profile-is-passed/script +++ b/acceptance/bundle/exec/databricks-cli/profile-is-passed/script @@ -8,7 +8,7 @@ unset DATABRICKS_HOST unset DATABRICKS_TOKEN # This should use the profile configured in the bundle, i.e. PAT auth -trace $CLI bundle exec -- databricks current-user me +trace $CLI bundle exec -- $CLI current-user me # This should use myprofile, which uses oauth. -trace $CLI bundle exec --profile myprofile -- databricks current-user me +trace $CLI bundle exec --profile myprofile -- $CLI current-user me diff --git a/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt b/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt index a17f177be..84a9653e9 100644 --- a/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt +++ b/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt @@ -1,23 +1,23 @@ ->>> [CLI] bundle exec -- databricks current-user me +>>> [CLI] bundle exec -- [CLI] current-user me { "id":"[USERID]", "userName":"[USERNAME]" } ->>> [CLI] bundle exec -t pat -- databricks current-user me +>>> [CLI] bundle exec -t pat -- [CLI] current-user me { "id":"[USERID]", "userName":"[USERNAME]" } ->>> errcode [CLI] bundle exec -t pat -- databricks current-user me -t oauth +>>> errcode [CLI] bundle exec -t pat -- [CLI] current-user me -t oauth Error: cannot resolve bundle auth configuration: validate: more than one authorization method configured: oauth and pat. Config: host=[DATABRICKS_URL], token=***, client_id=client_id, databricks_cli_path=[CLI]. Env: DATABRICKS_HOST, DATABRICKS_TOKEN, DATABRICKS_CLI_PATH -Error: Running "databricks current-user me -t oauth" failed with exit code: 1 +Error: Running "[CLI] current-user me -t oauth" failed with exit code: 1 Exit code: 1 ->>> [CLI] bundle exec -t oauth -- databricks current-user me +>>> [CLI] bundle exec -t oauth -- [CLI] current-user me { "id":"[USERID]", "userName":"[USERNAME]" diff --git a/acceptance/bundle/exec/databricks-cli/target-is-passed/script b/acceptance/bundle/exec/databricks-cli/target-is-passed/script index 1f44239df..9d2eb2fe7 100644 --- a/acceptance/bundle/exec/databricks-cli/target-is-passed/script +++ b/acceptance/bundle/exec/databricks-cli/target-is-passed/script @@ -1,15 +1,15 @@ # Default target -trace $CLI bundle exec -- databricks current-user me +trace $CLI bundle exec -- $CLI current-user me # Explicitly select default target -trace $CLI bundle exec -t pat -- databricks current-user me +trace $CLI bundle exec -t pat -- $CLI current-user me # Conflicting targets selected. This should fail because for the child command # pat would be configured via environment variables and oauth via the CLI resulting # in more than one authorization method configured. -trace errcode $CLI bundle exec -t pat -- databricks current-user me -t oauth +trace errcode $CLI bundle exec -t pat -- $CLI current-user me -t oauth # Explicitly select oauth target export DATABRICKS_TOKEN="" export DATABRICKS_CLIENT_SECRET="client_secret" -trace $CLI bundle exec -t oauth -- databricks current-user me +trace $CLI bundle exec -t oauth -- $CLI current-user me