-
Notifications
You must be signed in to change notification settings - Fork 35
fix(#82): handle provider version as list in .terraform.lock.hcl #83
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
fix(#82): handle provider version as list in .terraform.lock.hcl #83
Conversation
(削除) Hello @harlemtraveler and thanks for a lot for the contribution! It seems the CI is failing with the change, but I'm not too sure why.
Could you please share how to reproduce the issue so maybe we could add a test case for it, or that I could reproduce the issue myself?
I've tried running the CI on the main branch and it passed, so I suppose this change is breaking something but not too sure why without a reproducer. Thanks! (削除ここまで)
edit: I'm currently trying it out locally, and trying to run the CI again to see if it's a real issue. Will keep you updated 👍
CI is now green, I wonder what happened 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this seems like a fair change! Thanks for providing a fix, and welcome to the contributors! 🙏
Description
This PR resolves a TypeError that occurs when .terraform.lock.hcl contains the version field as a string, but recent versions of Terraform may emit the value as a list. This causes a TypeError within the get_provider_version_from_lock_file() function.
.terraform.lock.hcl content
Error returned from /bin/tflocal
TypeError: expected string or bytes-like object, got 'list'Fix
This fix checks for a list and safely parses the first element if necessary.