Skip to content

tf/aws: add download-version tf var #8599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

tf/aws: add download-version tf var #8599

wants to merge 1 commit into from

Conversation

calvn
Copy link
Contributor

@calvn calvn commented Mar 20, 2020

Small PR to add a download-version TF variable while still accepting download-url if that's provided.

@calvn calvn requested review from briankassouf and mjarmy March 20, 2020 22:38
curl -L "${download_url}" > /tmp/vault.zip
vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip

if [[ ! -z "${download_url}" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find positive conditions easier to read than negative ones. I might suggest changing the ! -z to -n, as I believe they are equivalent. I don't think the double brackets are required here either. I think single brackets would suffice.

@@ -6,7 +6,13 @@ sudo apt-get update -y
sudo apt-get install -y curl unzip

# Download Vault into some temporary directory
curl -L "${download_url}" > /tmp/vault.zip
vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth wrapping this URL in double quotes, since there are variables in it. See https://github.com/koalaman/shellcheck/wiki/SC2086 for more details.

vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip

if [[ ! -z "${download_url}" ]]; then
vault_download_url=${download_url}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as above re: double quotes.

@VioletHynes VioletHynes added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed release/build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants