Pass profile through to Terraform provider subprocess#4624
Merged
simonfaltum merged 2 commits intomainfrom Mar 2, 2026
Merged
Conversation
andrewnester
approved these changes
Mar 2, 2026
Collaborator
|
Commit: fe5c4b2
16 interesting tests: 7 KNOWN, 7 SKIP, 2 flaky
Top 22 slowest tests (at least 2 minutes):
|
Collaborator
|
Commit: 197a17a
34 interesting tests: 16 KNOWN, 8 RECOVERED, 6 flaky, 3 FAIL, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When multiple profiles in
~/.databrickscfgshare the same host,bundle deployfails duringterraform applywith a multi-profile ambiguity error, even when the correct profile is specified via--profileflag orworkspace.profileindatabricks.yml.This regressed when the SDK introduced multi-profile host matching validation (SDK v0.111.0+). The CLI itself handles this correctly, but the Terraform subprocess does not because:
libs/auth/env.gointentionally strippedDATABRICKS_CONFIG_PROFILEfrom the environment passed to Terraform.auth token --host <host>without--profile, and the CLI'sauth tokencommand did not check theDATABRICKS_CONFIG_PROFILEenv var when--hostwas provided.Changes
Two fixes, both in the CLI:
libs/auth/env.go: Stop stripping the profile from downstream environment variables. The original comment said this prevented "downstream tools from reloading the profile", but downstream tools need the profile to disambiguate when multiple profiles share a host.cmd/auth/token.go: InloadToken, fall back toDATABRICKS_CONFIG_PROFILEenv var when no--profileflag is provided. This handles older Terraform providers (like the currently pinned v1.109.0) that callauth token --host <host>without passing--profile.Test plan
libs/auth/,cmd/auth/)bundle deploy --profile <name>with multiple profiles sharing the same hostmake checkspassing