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

feat(execute.go): add flag specification for custom actions #25

Merged
merged 3 commits into from
Dec 3, 2019

Conversation

vdice
Copy link
Member

@vdice vdice commented Oct 2, 2019

Adds a flags section that can be added/used for all custom actions (as the flag list for a given terraform command may differ, we need a way to supply arbitrary values).

Closes #24
Depends on getporter/porter#681

@carolynvs
Copy link
Member

Seems like terraform supports both - and -- for its flags? Is that not working?

@vdice
Copy link
Member Author

vdice commented Oct 2, 2019

@carolynvs Indeed, it seems with most flags/options, -- is supported... but I had stumbled on --no-color, as one example where it didn't appear to work:

 $ terraform plan --no-color
flag provided but not defined: -no-color
Usage: terraform plan [options] [DIR-OR-PLAN]

  Generates an execution plan for Terraform.

  This execution plan can be reviewed prior to running apply to get a
  sense for what Terraform will do. Optionally, the plan can be saved to
  a Terraform plan file, and apply can take this plan file to execute
  this plan exactly.

  If a saved plan is passed as an argument, this command will output
  the saved plan contents. It will not modify the given plan.

Options:
...
  -no-color           If specified, output won't contain any color.
...

If it turned out that was really the only place, we/I should probably file an issue in the terraform cli... meanwhile, I figured it'd be safer to go the single - route as shown in the help text, etc.

@carolynvs
Copy link
Member

Gotcha! I had seen terraform listen to some of my flags in the past and didn't realize that was just luck. 😀

@jeremyrickard jeremyrickard merged commit b2b86e9 into getporter:master Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom action: Add support for arbitrary arguments/flags
3 participants