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 other comments that do not add relevant new information or questions, 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
Terraform has a filebase64 built-in function, but it doesn't seem like Packer supports it.
For what it's worth, if I try to use the file function on something that isn't valid UTF-8, Packer generates this error, which seems to imply the filebase64 function should exist:
Call to function "file" failed: contents of
*** are not valid UTF-8; use the
filebase64 function to obtain the Base64 encoded contents or the other file
functions (e.g. filemd5, filesha256) to obtain file hashing results instead.
Use Case(s)
Loading a binary file and embedding a base64 encoding of it into a cloud-init config, for example.
Potential configuration
Potential References
The text was updated successfully, but these errors were encountered:
Sounds like a good idea indeed, we most likely ported the file function over from Terraform, including the error message, without changing it, hence why it points to a function that doesn't yet exist in Packer.
This should be reasonably easy to port over too, I'll look into this right now, once ported over this will be available in the next version we release.
@elliottlawrence: PR is now open, may I ask you to test it out to be sure it matches your expectations? I have added some tests, but nothing beats real-life experience :)
If it gets approved in the current state, I'll merge it and we'll release it with Packer 1.12.0, which we've scheduled tentatively before end-of-year (probably December).
Community Note
Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
Description
Terraform has a
filebase64
built-in function, but it doesn't seem like Packer supports it.For what it's worth, if I try to use the
file
function on something that isn't valid UTF-8, Packer generates this error, which seems to imply thefilebase64
function should exist:Use Case(s)
Loading a binary file and embedding a base64 encoding of it into a cloud-init config, for example.
Potential configuration
Potential References
The text was updated successfully, but these errors were encountered: