Skip to content

Commit

Permalink
fix(build): add env var to point to provider config
Browse files Browse the repository at this point in the history
  • Loading branch information
lbergnehr committed Jan 24, 2025
1 parent f8eefb8 commit 6b0cc87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/terraform/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN cd $BUNDLE_DIR/{{.WorkingDir}} && \
}
}
EOF
ENV TF_CLI_CONFIG_FILE=$BUNDLE_DIR/{{.WorkingDir}}/provider_mirror.tfrc
{{ else }}
terraform init -backend=false && \
rm -fr .terraform/providers && \
Expand Down
2 changes: 2 additions & 0 deletions pkg/terraform/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ func TestMixin_Build(t *testing.T) {

if tc.expectedProviderHost != "" {
assert.Contains(t, gotOutput, tc.expectedProviderHost)
assert.Contains(t, gotOutput, "ENV TF_CLI_CONFIG_FILE=")
} else {
assert.NotContains(t, gotOutput, "network_mirror")
assert.NotContains(t, gotOutput, "TF_CLI_CONFIG_FILE")
}

assert.NotContains(t, "{{.", gotOutput, "Not all of the template values were consumed")
Expand Down

0 comments on commit 6b0cc87

Please sign in to comment.