-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add sha256sum check when downloading from hashicorp #7
Conversation
} | ||
sha256Sum := h.Sum(nil) | ||
|
||
if checkSha256Sum != "" { |
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.
I'm not sure when this would be the empty string - does HashiCorp occasionally not include checksums for certain builds?
break | ||
} | ||
} | ||
|
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.
Related to the other comment I left - should we fail if we didn't find the checksum?
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.
I'm worry about the string spit on double space " " may broken in some release. This should be replaced with a better regex match. I will fix it and add the error handling logic if cannot find the checksum.
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.
left a minor comment about what we should do with an empty checksum, but otherwise LGTM!
thanks. I'll replace the find checksum logic with a regex match and add error handling logic in next PR. |
terraform_${version}_SHA256SUMS