Skip to content
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

Doesn't handle arguments after -- #9

Open
szymonrychu opened this issue Mar 27, 2018 · 3 comments
Open

Doesn't handle arguments after -- #9

szymonrychu opened this issue Mar 27, 2018 · 3 comments
Labels
moreinfo More information required about issue

Comments

@szymonrychu
Copy link

szymonrychu commented Mar 27, 2018

So- when I'm trying to pass additional arguments to terraform call after --, those arguments aren't being propagated to any terraform call.

Example invocation:

bash -x ./bin/terraform.sh --action plan --project XXX --environment XXX --component XXX --bucket-prefix XXX --region eu-west-1 -- -var journal_sha256sum=wRFZ/rvP3I8H4what3v3r9/qSmD2b1kZRQ=

invocation of terraform plan later in the script:

terraform plan -input=false -refresh=true -module-depth=-1 -var region=eu-west-1 -var project=XXX -var bucket_name=XXX -var aws_account_id=XXX -var-file=../../etc/env_eu-west-1_XXX.tfvars
@Zordrak
Copy link
Collaborator

Zordrak commented Mar 28, 2018

Would need more information to understand why this is happening for you. We use additional arguments for absolutely everything we do, so it certainly works in general.

You're executing with -x -- so where in the trace output are the args being dropped. During getopt?

Also, what OS is this being run on? Macs throw all kinds of troubles by not using GNU toolset by default.

@Zordrak Zordrak added the moreinfo More information required about issue label Jun 8, 2019
@adamyaziji
Copy link

adamyaziji commented Feb 22, 2022

I'm having this issue also.

Currently using 1.7.0. The command I am using is

tplan () {
    ./bin/terraform.sh -a 'plan' -c $1 -e $2 -p 'foo' -r 'eu-west-1' -b 'bar'
}

I have gnu-getopt installed via homebrew. The result of getopt_out=$(getopt -T) when running in my terminal is --.

I believe this is causing issues as I get the error message

ERROR: Non GNU getopt detected. If you're using a Mac then try "brew install gnu-getopt"

I have only started having this issue since using an M1 Macbook Pro, it was fine on my Intel chip. Do you have any advice please?

If you need any more information, just let me know!

@edmundcraske-bjss
Copy link
Contributor

@adamyaziji is the brew-installed version of getopt in your path?
which getopt should return something like /usr/local/opt/gnu-getopt/bin/getopt rather than /usr/bin/getopt - it seems like although you have installed it, you have not ensured that it is used instead of the system getopt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moreinfo More information required about issue
Projects
None yet
Development

No branches or pull requests

4 participants