mirror of https://github.com/databricks/cli.git
comment
This commit is contained in:
parent
c8ac08c24b
commit
58bf931308
|
@ -145,17 +145,23 @@ func Execute(ctx context.Context, cmd *cobra.Command) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want child telemetry processes to inherit environment variables like $HOME or $HTTPS_PROXY
|
||||||
|
// because they influence auth resolution.
|
||||||
func inheritEnvVars() []string {
|
func inheritEnvVars() []string {
|
||||||
base := os.Environ()
|
base := os.Environ()
|
||||||
out := []string{}
|
out := []string{}
|
||||||
authEnvVars := auth.EnvVars()
|
authEnvVars := auth.EnvVars()
|
||||||
|
|
||||||
// Remove any existing auth environment variables. This is important because
|
// Remove any existing auth environment variables. This is done because
|
||||||
// the CLI offers multiple levels of configuring authentication like `--profile`
|
// the CLI offers multiple modalities of configuring authentication like
|
||||||
// or `DATABRICKS_CONFIG_PROFILE` or `profile: <profile>` in the bundle config file.
|
// `--profile` or `DATABRICKS_CONFIG_PROFILE` or `profile: <profile>` in the
|
||||||
|
// bundle config file.
|
||||||
//
|
//
|
||||||
// Each of these have different priorities and thus we don't want any auth configuration
|
// Each of these modalities have different priorities and thus we don't want
|
||||||
// to piggyback into the child process environment.
|
// any auth configuration to piggyback into the child process environment.
|
||||||
|
//
|
||||||
|
// This is a precaution to avoid conflicting auth configurations being passed
|
||||||
|
// to the child telemetry process.
|
||||||
for _, v := range base {
|
for _, v := range base {
|
||||||
k, _, found := strings.Cut(v, "=")
|
k, _, found := strings.Cut(v, "=")
|
||||||
if !found {
|
if !found {
|
||||||
|
|
Loading…
Reference in New Issue