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

Potential issue with global flags #1163

Closed
rhoboat opened this issue Aug 2, 2022 · 2 comments
Closed

Potential issue with global flags #1163

rhoboat opened this issue Aug 2, 2022 · 2 comments
Labels
bug Something isn't working more-information-needed p:needs triage Needs to be processed by maintainer and issue type / priority added

Comments

@rhoboat
Copy link
Contributor

rhoboat commented Aug 2, 2022

We might have to fix this line for newer versions of Terraform.

args := []string{"init", fmt.Sprintf("-upgrade=%t", options.Upgrade)}

This was observed today when using Terraform 1.2.6 with Terratest v0.40.17:

TestUpgradeModules 2022-08-02T19:48:14Z retry.go:91: terraform [init -upgrade=true]
TestUpgradeModules 2022-08-02T19:48:14Z logger.go:66: Running command terraform with args [init -upgrade=true]
TestUpgradeModules 2022-08-02T19:48:14Z logger.go:66: �[31mUsage: terraform [global options] init [options]

Full logs are in a test run on Linux_amd64 in terraform-aws-ecs: https://app.circleci.com/pipelines/github/gruntwork-io/terraform-aws-ecs/484/workflows/f2783998-c28b-4bbb-af75-09df063c3d4b/jobs/3577/artifacts (see docker-fargate-service-with-alb.log)

Testing locally on darwin_amd64 with 1.2.x versions, terraform init -upgrade and terraform init -upgrade=true work.

This issue is still being investigated so we may find out there is something else going on here.
If this is in fact an issue, we'll have to update all documentation (release notes, etc) where we advise users to run terraform init -upgrade.

@rhoboat rhoboat added p:needs triage Needs to be processed by maintainer and issue type / priority added bug Something isn't working labels Aug 2, 2022
@rhoboat rhoboat changed the title Potential issue with global flag order Potential issue with global flags Aug 2, 2022
@rhoboat
Copy link
Contributor Author

rhoboat commented Aug 4, 2022

Closing at this issue was found to have been caused by another function adding unsupported CLI args to this call.

@rhoboat rhoboat closed this as completed Aug 4, 2022
@rhoboat
Copy link
Contributor Author

rhoboat commented Aug 4, 2022

The underlying error was fixed by #1164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working more-information-needed p:needs triage Needs to be processed by maintainer and issue type / priority added
Projects
None yet
Development

No branches or pull requests

1 participant