You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
Google cloud has a facility to give md5 hash in hexadecimal format as well by using -h flag in gsutil, see here. But this provider only provides the md5 hash (see here)which is obtained by converting this hexadecimal hash to binary and then doing base 64 encoding to it which is unusual. It would be helpful if this provider could simply leverage this built in feature provided by GCP.
New or Affected Resource(s)
google_storage_bucket_object
Potential Terraform Configuration
output"uploaded_gcp_md5_hash_matched" {
value="${google_storage_bucket_object.gcp_controller_dir.md5hexhash==var.gcp_controller_md5?"Yes":"No, please re-run the script as md5 hash didn't match"}"
}
The text was updated successfully, but these errors were encountered:
The base64 md5 hash for the object that is computed by the server is represented by the field md5Hash in the resource representation. However, there isn't a field that can provide the md5 hash in hexadecimal form.
The probable fix would be to add a new output-only field called md5HexHash. Its value can be obtained from the md5Hash by converting base64 to hex.
Possible conversion from base64 to hex for md5Hash:
// decode first
p, err := base64.StdEncoding.DecodeString(response["md5Hash"])
if err != nil {
// handle error
}
// encode
hmd5HexHash:= hex.EncodeToString(p)
fmt.Println(md5HexHash) // prints md5HexHash
Community Note
Description
Google cloud has a facility to give md5 hash in hexadecimal format as well by using
-h
flag ingsutil
, see here. But this provider only provides the md5 hash (see here)which is obtained by converting this hexadecimal hash to binary and then doing base 64 encoding to it which is unusual. It would be helpful if this provider could simply leverage this built in feature provided by GCP.New or Affected Resource(s)
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: