ls: fix duplicated builders for json format#2970
Merged
tonistiigi merged 1 commit intodocker:masterfrom Feb 10, 2025
Merged
Conversation
Signed-off-by: CrazyMax <[email protected]>
tonistiigi
reviewed
Feb 8, 2025
| } | ||
| continue | ||
| } | ||
| if ctx.Format.IsJSON() { |
Member
There was a problem hiding this comment.
So JSON output does not allow seeing multi-node builders and their properties/endpoints?
Member
Author
There was a problem hiding this comment.
json format marshals the builder with list of nodes:
Lines 211 to 213 in 0a4eb7e
{
"Name":"builder",
"Driver":"docker-container",
"LastActivity":"2025-02-06T15:15:12Z",
"Dynamic":false,
"Nodes":[
{
"Name":"builder0",
"Endpoint":"unix:///var/run/docker.sock",
"Flags":[
"--debug",
"--allow-insecure-entitlement",
"security.insecure",
"--allow-insecure-entitlement",
"network.host"
],
"DriverOpts":{
"env.BUILDKIT_STEP_LOG_MAX_SIZE":"10485760",
"env.BUILDKIT_STEP_LOG_MAX_SPEED":"10485760",
"env.JAEGER_TRACE":"localhost:6831",
"image":"moby/buildkit:master"
},
"Status":"running",
"Version":"4b36562",
"IDs":[
"v6u0iluh9v6ixuqwvybs60qzj"
],
"Platforms":[
"linux/amd64",
"linux/amd64/v2",
"linux/amd64/v3",
"linux/arm64",
"linux/riscv64",
"linux/ppc64le",
"linux/s390x",
"linux/386",
"linux/arm/v7",
"linux/arm/v6"
],
"GCPolicy":[
{
"all":false,
"filter":[
"type==source.local,type==exec.cachemount,type==source.git.checkout"
],
"keepDuration":172800000000000,
"reservedSpace":0,
"maxUsedSpace":512000000,
"minFreeSpace":0
},
{
"all":false,
"filter":null,
"keepDuration":5184000000000000,
"reservedSpace":10000000000,
"maxUsedSpace":100000000000,
"minFreeSpace":202000000000
},
{
"all":false,
"filter":null,
"keepDuration":0,
"reservedSpace":10000000000,
"maxUsedSpace":100000000000,
"minFreeSpace":202000000000
},
{
"all":true,
"filter":null,
"keepDuration":0,
"reservedSpace":10000000000,
"maxUsedSpace":100000000000,
"minFreeSpace":202000000000
}
],
"Labels":{
"org.mobyproject.buildkit.worker.executor":"oci",
"org.mobyproject.buildkit.worker.hostname":"e885c15d9fbc",
"org.mobyproject.buildkit.worker.network":"host",
"org.mobyproject.buildkit.worker.oci.process-mode":"sandbox",
"org.mobyproject.buildkit.worker.selinux.enabled":"false",
"org.mobyproject.buildkit.worker.snapshotter":"overlayfs"
}
}
]
}
While table and go template output has an entry for each builder and node. This is similar to what docker service ps does: https://docs.docker.com/reference/cli/docker/service/ps/#examples.
tonistiigi
approved these changes
Feb 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #2969
JSON format for
lscommand without Go template (--format json) should not set nodes in formatter context.