-
Notifications
You must be signed in to change notification settings - Fork 482
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
Add ability to output json lists in metadata build file #2777
Add ability to output json lists in metadata build file #2777
Conversation
commands/build.go
Outdated
out := make(map[string]interface{}) | ||
for k, v := range response { | ||
var dt []byte | ||
j, ok := v.(string) |
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.
If this means that any base64 string is decoded then I don't think that can be done as false positives can happen when regular string happens to be valid base64. Valid JSON array could work though, assuming that previous versions of buildx does not produce an error (previous versions failing to decode is unavoidable I guess).
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 if this comment was addressed. Looks like any value can be base64 encoded now. To avoid false positives, should be limited to JSON arrays and objects. Eg. "MTU0" should not be decoded to "154"
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 removed all of this code. The new code is much smaller and doesn't touch the existing base64 handling
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.
But it does change the valid values from JSON objects to any value afaics
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.
AAh, check out this new version then that is a bit more prescriptive
ce86a92
to
7fa1637
Compare
@tonistiigi thanks! I missed that function! |
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
7fa1637
to
be6d832
Compare
Supports metadata descriptors list in BuildKit moby/buildkit#5454