-
Notifications
You must be signed in to change notification settings - Fork 131
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
Use go-homedir.Dir() everywhere #314
Conversation
Signed-off-by: Ahmed Kamal <[email protected]>
Signed-off-by: Ahmed Kamal <[email protected]>
Hey @kim0
ps: this PR may also become stale as both owner (@warrensbox) and another contributor (@jukie) are more of not with this project rather than with it 😢 |
Signed-off-by: Ahmed Kamal <[email protected]>
Hello @yermulnik Thanks a lot for your feedback. I'm not that great with Golang either, I didn't think It's sorta sad that the maintainers are no longer active mostly. My use-case involves running tfswitch with a read-only home directory on AWS lambda, which causes errors since tfswitch insists on writing to the home directory and does not respect |
Would the https://github.com/warrensbox/terraform-switcher#use-tfswitchtoml-file--for-non-admin---users-with-limited-privilege-on-their-computers be an option for your use case? You also can provide binary path as command line arg.
🤞🏻 |
Thanks a lot for the reply @yermulnik .. wrt the suggested root@5bc5fcb6879a:~# pwd
/root
root@5bc5fcb6879a:~# touch foo
touch: cannot touch 'foo': Read-only file system
root@5bc5fcb6879a:~# tfswitch -u -b /tmp/terraform
Creating directory for terraform binary at: /root/.terraform.versions
Unable to create directory for terraform binary at: /root/.terraform.versionspanic: mkdir /root/.terraform.versions: read-only file system
goroutine 1 [running]:
github.com/warrensbox/terraform-switcher/lib.CreateDirIfNotExist({0xc000327300, 0x19})
/home/circleci/go/src/github.com/warrensbox/terraform-switcher/lib/files.go:112 +0x147
github.com/warrensbox/terraform-switcher/lib.GetInstallLocation()
/home/circleci/go/src/github.com/warrensbox/terraform-switcher/lib/install.go:72 +0xca
github.com/warrensbox/terraform-switcher/lib.Install({0xc000300651, 0x5}, {0x7ffdda050f10?, 0xc0000920f0?}, {0x9e004d, 0x28})
/home/circleci/go/src/github.com/warrensbox/terraform-switcher/lib/install.go:94 +0x70
main.installLatestVersion(0xc00016acb0, 0xc00016ad90)
/home/circleci/go/src/github.com/warrensbox/terraform-switcher/main.go:237 +0x50
main.main()
/home/circleci/go/src/github.com/warrensbox/terraform-switcher/main.go:179 +0xc9f
root@5bc5fcb6879a:~# echo $?
2
root@5bc5fcb6879a:~# ls -l /tmp/terraform
ls: cannot access '/tmp/terraform': No such file or directory So given this failure, are you interested in merging this PR please? Let me know, thanks! |
Signed-off-by: Ahmed Kamal <[email protected]>
Sorry @yermulnik I confused you with being a maintainer .. Guess I'll have to wait more or find some other solution |
This can also close #117 since the binary will now respect $HOME which can be set to any location instead of ~/.terraform.versions