Skip to content

tenv tf install not honoring TFENV_HASHICORP_PGP_KEY environment variable #390

@batman9326

Description

@batman9326

I noticed that tenv tf install <release> is not honoring the TFENV_HASHICORP_PGP_KEY variable. But, If I try to install from the interactive menu from invoking tenv command or If I pass the -k flag to the tenv tf install it honors.

To Reproduce


root@184766599c6d:/opt# curl https://www.hashicorp.com/.well-known/pgp-key.txt -o /opt/pgp-key.txt

root@184766599c6d:/opt# export TFENV_HASHICORP_PGP_KEY="/opt/pgp-key.txt"

root@184766599c6d:/opt# echo $TFENV_HASHICORP_PGP_KEY

/opt/pgp-key.txt

root@184766599c6d:/opt# tenv --version

tenv version v4.4.0

root@184766599c6d:/opt# tenv tf install 1.11.2

Installing Terraform 1.11.2

Fetching release information from https://releases.hashicorp.com/terraform/1.11.2/index.json

Downloading https://releases.hashicorp.com/terraform/1.11.2/terraform_1.11.2_linux_arm64.zip

Downloading https://releases.hashicorp.com/terraform/1.11.2/terraform_1.11.2_SHA256SUMS

Downloading https://releases.hashicorp.com/terraform/1.11.2/terraform_1.11.2_SHA256SUMS.sig

**Downloading https://www.hashicorp.com/.well-known/pgp-key.txt**

Installation of Terraform 1.11.2 successful

You can see that even with the environment variable set, tenv still downloaded the PGP key from the remote URL.

With tenv interactive menu it honors the environment variable and ignores downloading the PGP key from remote.


root@184766599c6d:~# tenv

Fetching all releases information from https://releases.hashicorp.com/terraform/index.json

Installing Terraform 1.11.1

Fetching release information from https://releases.hashicorp.com/terraform/1.11.1/index.json

Downloading https://releases.hashicorp.com/terraform/1.11.1/terraform_1.11.1_linux_arm64.zip

Downloading https://releases.hashicorp.com/terraform/1.11.1/terraform_1.11.1_SHA256SUMS

Downloading https://releases.hashicorp.com/terraform/1.11.1/terraform_1.11.1_SHA256SUMS.sig

Installation of Terraform 1.11.1 successful

root@184766599c6d:~#

Expected behavior
tenv tf install 1.11.2 should detect the environment variable and read the PGP key from the variable.

Environment:

  • OS: [Ubuntu:Jammy]

  • tenv version [4.4.0]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions