From 58bf9313083b3094a7f82b110fc0f78d292e69d5 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 10 Feb 2025 17:11:49 +0100 Subject: [PATCH] comment --- cmd/root/root.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/root/root.go b/cmd/root/root.go index 75754f3ba..0d2489126 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -145,17 +145,23 @@ func Execute(ctx context.Context, cmd *cobra.Command) error { return err } +// We want child telemetry processes to inherit environment variables like $HOME or $HTTPS_PROXY +// because they influence auth resolution. func inheritEnvVars() []string { base := os.Environ() out := []string{} authEnvVars := auth.EnvVars() - // Remove any existing auth environment variables. This is important because - // the CLI offers multiple levels of configuring authentication like `--profile` - // or `DATABRICKS_CONFIG_PROFILE` or `profile: ` in the bundle config file. + // Remove any existing auth environment variables. This is done because + // the CLI offers multiple modalities of configuring authentication like + // `--profile` or `DATABRICKS_CONFIG_PROFILE` or `profile: ` in the + // bundle config file. // - // Each of these have different priorities and thus we don't want any auth configuration - // to piggyback into the child process environment. + // Each of these modalities have different priorities and thus we don't want + // 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 { k, _, found := strings.Cut(v, "=") if !found {