jsonnet
jsonnet copied to clipboard
Add `importbin` statement
Add importbin. Like importstr but returns an array of
numbers (integers 0-255).
Note! This changes the JsonnetImportCallback function type
signature, and requires modification to existing code that uses custom
import callbacks. The included python bindings have been updated.
Reviewers: It's been a long time since I last wrote C++ - please treat everything with suspicion.
Re the import callback change: We could add a new/additional binary-safe import callback, and fallback to the existing c-string import callback. That will keep existing code compatibility, but I think it will be worse overall, since we now have an importbin statement that will fail at runtime in some jsonnet environments without warning. Happy to re-implement this PR if we want to follow some other migration strategy.
Edit: Oh, and I haven't actually tested/executed the python change at all, since that required bazel, and I was kind of hoping a github action/magic-ci-bot would do that for me (but no?).
Hi, sorry for pinging like this on this PR
I am using a version of kubecfg with go-jsonnet from master so that i can use importbin ( and it is working as expected ) but this is of course breaking any jsonnet and jsonnetfmt command i run since support for importbin is not merged in it yet.
Is there any ETA / plan to merge this ?
thanks again
What's the status exactly? If it's in go-jsonnet already then you can use jsonnet and jsonnetfmt from there.
I did not know there was a jsonnetfmt from there i will try that
Having said that, I am in favour of getting this PR in :)