Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LaurentGoderre
Copy link
Member

Supports metadata descriptors list in BuildKit moby/buildkit#5454

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
var dt []byte
j, ok := v.(string)
if ok {
d, err := base64.StdEncoding.DecodeString(string(j))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a decoder in decodeExporterResponse in the same code path, so it shouldn't be duplicated.

out := make(map[string]interface{})
for k, v := range response {
var dt []byte
j, ok := v.(string)
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants