-
Notifications
You must be signed in to change notification settings - Fork 137
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
Reading automatically from ~/.tfswitch.toml is broken #417
Comments
The problem is, that the code only looks for a toml (or any other config file for that matter) if the -c param is defined. For the time being please use the -c param |
Using the |
Wait... is there a version.tf file in the same folder @dixneuf19 ? |
Yes, this is defo a bug as this breaks old behavior. I also think this is what's supposed and even what's "must-have": each item from the list of var sources is read if present and params from items with higher precedence overwrite params from lower precedence files. Why read them all and always: files may be present, but may not have TF version definition parameters set. ps: is the docu site kinda broken? I encounter broken links from the README and also I see a truncated list of items here: https://tfswitch.warrensbox.com/usage/general/ 😕 |
I'd be happy to take a look into this, but just need confirmation of expected behavoir - is the order of preseidence:
|
@MatthewJohn Great 👍🏻 Please refer to https://github.com/warrensbox/terraform-switcher/blob/docs/Update_Site_and_README/www/docs/usage/general.md for the precedence order. Items 2-6 are what you mean: @warrensbox Please weigh in if the below isn't fully correct:
|
Yes @yermulnik is right. Having a toml file should let us use other config files itself. We had this in the old code. In the old code: https://github.com/warrensbox/terraform-switcher/blob/1.0.2/main.go#L102 If the toml file existed
AND also use the configuration in the other files if provided: ( Nested switch statement)
The toml file has the location of the bin path (which is the most important bit). You can also specify the version in the toml file, but it can be overridden later (see code above). As an example, the user does not want to keep passing in the location of the bin path everytime they run |
Technically, in the previous behavior, the BIN path in the toml file had the highest precedent, only the bin path or the version can be overridden later. |
Feel free to add your suggestions here: |
@MatrixCrawler I assume you're currently working on this (based on assignee)? If not, happy to help out :) |
@yermulnik was working on re-documenting the precedence. |
Please see #419 (comment) |
@MatrixCrawler do you need help with this? |
Hey @dixneuf19 , Apologies for the wait, just to keep you up to date - we've had some discussions on this (#420) and I'd hope that #429 should certainly fix your issues :) Just waiting for some reviews on it :) Thanks |
He folks, any update on this bug? |
Once we get #429 merged and get new release cut, this will be hopefully fixed. As a temp solution you may want to downgrade to previous version of |
No rush, thanks so much! I just downgraded and works fine. |
Hi,
I recently upgraded tfswitch and found out that my binaries stopped going into my custom location
/home/dixneuf19/.local/bin/terraform
.I configured this behaviour a long ago with a
~/.tfswitch.toml
Now with the latest 1.1.1 version, It does not read this file at all and save the binary into the default folder.
I could simply add this path to PATH but I don't think this breaking change is wanted.
It seems to be linked to this PR https://github.com/warrensbox/terraform-switcher/pull/356/files#diff-70bb7ecbe02c1c0fb2f1ba6c3626d57287498e82043aca43fa54cb8649c12392 from @MatrixCrawler which modified quite a lot of things.
Now the code which check for the
~/.tfswitch.toml
needs the-c
arg to be executed, which is not the wanted behaviour.Is this a know and undocumented regression, or a bug ?
Anyway for now I will add the
~/bin
folder to my path as a workaround.Anyway thanks for your work on this still very useful tool !
The text was updated successfully, but these errors were encountered: