it is checked a value with no parameter is passed. When this happens there is the chance of user running apply on an already created plan, e.g.:
leverage tf apply thesecretplan
In this case, all the default parameters have to be removed from the command since Terraform does not allow passing -var or -var-file when applying a saved plan.
Because the way the loop has made, when passing a parameter without the "=" sign, it understands as if it were a plan.
So a list of parameters and flags has to be made in order to be able to check all the possibilities, e.g.:
-target=kubernetes_manifest.irfq
-target kubernetes_manifest.irfq
-no-color
etc
Expected Behavior
It should accept both ways of setting command line parameters.
Steps to Reproduce
Steps to reproduce the behavior:
Go to a RefArch layer
Run leverage tf apply -target kubernetes_manifest.irfq (change the resource name with one that exists in your layer)
Hit Enter
See error
Screenshots
$:~/.../apps-qa/us-east-1/k8s-eks/k8s-workloads$ leverage tf apply -target kubernetes_manifest.irfq
[15:27:40] INFO MFA: Found 1 profile/s
[15:27:40] INFO MFA: Attempting to get temporary credentials for profile arta-apps-qa-devops
MFA: Please type in your OTP: 999999
[15:28:09] INFO MFA: Credentials written succesfully!
Acquiring state lock. This may take a few moments...
var.accounts
Accounts Email & Id
Enter a value:
It asks you for a value when it should not do this.
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Describe the Bug
The Leverage CLI will fail due to a lack of variable values when apply is passed with a parameter with space. E.g.
instead of
In this loop: https://github.com/binbashar/leverage/blob/937956a8622c31eb4bf4932d97a4ce4dc7283cb9/leverage/modules/terraform.py#L310
it is checked a value with no parameter is passed. When this happens there is the chance of user running apply on an already created plan, e.g.:
In this case, all the default parameters have to be removed from the command since Terraform does not allow passing
-var
or-var-file
when applying a saved plan.Because the way the loop has made, when passing a parameter without the "=" sign, it understands as if it were a plan.
So a list of parameters and flags has to be made in order to be able to check all the possibilities, e.g.:
etc
Expected Behavior
It should accept both ways of setting command line parameters.
Steps to Reproduce
Steps to reproduce the behavior:
leverage tf apply -target kubernetes_manifest.irfq
(change the resource name with one that exists in your layer)Screenshots
It asks you for a value when it should not do this.
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Additional Context
n/a
IMPORTANT
Add test cases for this scenario.