Skip to content

Commit 74afd55

Browse files
authored
Merge pull request #34 from upbound/backport-18-to-release-0.2
[Backport release-0.2] Fix: switch back to TF_ prefixes for opentofu env vars
2 parents 682be09 + 1c4b5e2 commit 74afd55

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cluster/images/provider-opentofu/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG TARGETARCH
55

66
ENV OPENTOFU_VERSION=1.9.0
77
ENV TF_IN_AUTOMATION=1
8-
ENV TOFU_PLUGIN_CACHE_DIR=/tofu/plugin-cache
8+
ENV TF_PLUGIN_CACHE_DIR=/tofu/plugin-cache
99

1010
ADD "bin/${TARGETOS}_${TARGETARCH}/provider" /usr/local/bin/crossplane-opentofu-provider
1111
ADD .gitconfig .gitconfig
@@ -14,7 +14,7 @@ RUN curl -s -L https://github.com/opentofu/opentofu/releases/download/v${OPENTOF
1414
&& unzip -d /usr/local/bin tofu.zip \
1515
&& rm tofu.zip \
1616
&& chmod +x /usr/local/bin/tofu \
17-
&& mkdir -p ${TOFU_PLUGIN_CACHE_DIR} \
17+
&& mkdir -p ${TF_PLUGIN_CACHE_DIR} \
1818
&& chown -R 2000 /tofu
1919
# As of Crossplane v1.3.0 provider controllers run as UID 2000.
2020
# https://github.com/crossplane/crossplane/blob/v1.3.0/internal/controller/pkg/revision/deployment.go#L32

internal/opentofu/opentofu.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ func (h Harness) Init(ctx context.Context, o ...InitOption) error {
177177
cmd := exec.Command(h.Path, args...) //nolint:gosec
178178
cmd.Dir = h.Dir
179179
for _, e := range os.Environ() {
180-
if strings.Contains(e, "TOFU_PLUGIN_CACHE_DIR") {
180+
if strings.Contains(e, "TF_PLUGIN_CACHE_DIR") {
181181
if !h.UsePluginCache {
182182
continue
183183
}
184184
}
185185
cmd.Env = append(cmd.Env, e)
186186
}
187-
cmd.Env = append(cmd.Env, "TOFU_CLI_CONFIG_FILE=./.tofurc")
187+
cmd.Env = append(cmd.Env, "TF_CLI_CONFIG_FILE=./.tofurc")
188188
if len(h.Envs) > 0 {
189189
cmd.Env = append(cmd.Env, h.Envs...)
190190
}

0 commit comments

Comments
 (0)