Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ tfenv install
```

The `trust-tfenv` directive means that verification uses a copy of the
Hashicorp OpenPGP key found in the tfenv repository. Skipping that directive
Hashicorp OpenPGP key found in the tfenv repository. Skipping that directive
means that the Hashicorp key must be in the existing default trusted keys.
Use the file `${TFENV_INSTALL_DIR}/use-gnupg` to instead invoke the full `gpg` tool and
see web-of-trust status; beware that a lack of trust path will not cause a
Expand Down Expand Up @@ -231,6 +231,20 @@ functionality will be restored.
TFENV_REVERSE_REMOTE=1 tfenv list-remote
```

##### `TFENV_SKIP_REMOTE_CHECK`

Integer (Default: 0)

When using a custom remote, such as Artifactory, lazy caching may be used meaning the versions
returned by the remote aren't the full list available (more can be pulled on demand). This option
disables the pre-install validation and will blindly pull the requested version from the remote. When
using `latest` as the specified version, this will still rely on the latest version returned from the
configured remote.

```console
TFENV_SKIP_REMOTE_CHECK=1 tfenv install 1.14.5
```

##### `TFENV_CONFIG_DIR`

Path (Default: `$TFENV_ROOT`)
Expand Down
6 changes: 4 additions & 2 deletions libexec/tfenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ declare regex="${resolved##*\:}";

log 'debug' "Processing install for version ${version}, using regex ${regex}";

remote_version="$(tfenv-list-remote | grep -e "${regex}" | head -n 1)";
[ -n "${remote_version}" ] && version="${remote_version}" || log 'error' "No versions matching '${requested:-$version}' found in remote";
if [ "${TFENV_SKIP_REMOTE_CHECK:-0}" -eq 0 ]; then
remote_version="$(tfenv-list-remote | grep -e "${regex}" | head -n 1)";
[ -n "${remote_version}" ] && version="${remote_version}" || log 'error' "No versions matching '${requested:-$version}' found in remote";
fi;

dst_path="${TFENV_CONFIG_DIR}/versions/${version}";
if [ -f "${dst_path}/terraform" ]; then
Expand Down