Error in v1.10 parsing version
Closed this issue · 3 comments
Since the latest version has been released, we have broken pipelines that cannot resolve the TF version. We did not have issue issue yesterday. It is complaining of a double = character. Checking the versions.tf we have "=1.7.5" specified.
2024/04/25 10:00:56.109010 Running command tfswitch 10:00:56.160 FATAL Error parsing configuration file: "error parsing constraint: Malformed constraint: = =1.7.5"
Versions.tf file:
required_version = "=1.7.5"
I cannot reproduce that in the moment.
My version.tf looks like this
terraform {
required_version = "= 1.7.5"
}
which works fine.
Could you please run tfswitch with --log-level=DEBUG
and post the output?
I can reproduce it when there is no space between the = and the version number
Invalid version.tf
terraform {
required_version = "=1.7.5"
}
The error is here
https://github.com/warrensbox/terraform-switcher/blob/master/lib/param_parsing/versiontf.go#L44-L52
We will fix that. Thanks for pointing out.