Closed borland667 closed 5 days ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
leverage/logger.py | 4 | 5 | 80.0% | ||
leverage/modules/terraform.py | 36 | 54 | 66.67% | ||
<!-- | Total: | 44 | 63 | 69.84% | --> |
Totals | |
---|---|
Change from base Build 8847843590: | 0.2% |
Covered Lines: | 2042 |
Relevant Lines: | 2846 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
leverage/logger.py | 4 | 5 | 80.0% | ||
leverage/modules/terraform.py | 12 | 15 | 80.0% | ||
<!-- | Total: | 20 | 24 | 83.33% | --> |
Totals | |
---|---|
Change from base Build 8847843590: | 0.1% |
Covered Lines: | 2011 |
Relevant Lines: | 2800 |
After consulting with @borland667 I've pushed a simplification to the originally proposed solution.
The only thing we really need to worry is to find out if we are receiving a plan file as a last argument for the apply command. And in turn, prepend or not our terraform default parameters, which basically are the references to the correct .tfvar
files.
Instead of parsing the entirety of the parameters, looking at the last two or so received arguments we can deduct if the last one is a positional argument or not (the plan file is the only positional parameter supported by plan
). Any other errors/incompatibilities that the user may have introduced in the arguments we leave to terraform to decide.
What?
Simplified solution:
-var-file
arguments. These arguments collide with the presence of a plan file argument, so we need to implement logic to detect whether the user provided such argument or not, and then decide whether we need to add the variable file references to the rest of the arguments or not.Why?
References
closes #159
, if this PR closes a GitHub issue#159
Before release
Review the checklist here