240 Commits
Author SHA1 Message Date
Sebastiaan van Stijn c1ca724d3c daemon/server: use t.Context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-18 18:28:46 +02:00
Sebastiaan van Stijn c47560390b daemon/server/router/grpc: fix linting for deprecated http2 code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-09 12:47:44 +02:00
Sebastiaan van Stijn 67755e0655 Merge pull request #53463 from zhangyoufu/19189-umask
Add umask support
2026-09-03 15:23:16 +02:00
Paweł GronowskiandYoufu Zhang 235d2876f8 api: Add container umask configuration
Add HostConfig.Umask and pass it to the OCI process spec for container
entrypoints, exec processes, and healthchecks.

Preserve the configured umask when exec user resolution reconstructs the
OCI User value, so runtimes receive it in the per-exec process spec.

Keep the field aligned with OCI's uint32 representation - raw JSON
clients need to use 18 for octal 0022 for example.

Co-authored-by: Youfu Zhang <zhangyoufu@gmail.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 10:41:23 +02:00
Sebastiaan van Stijn 36f51dfaa9 daemon/server/httputils: add contentencoding package
Add a small wrapper around gddo's NegotiateContentEncoding utility
with a signature tailored to our use, accepting just the request
headers instead of the whole request.

This keeps content-encoding negotiation behind an internal API,
similar to the existing contenttype package, and prepares for
internalising the gddo implementation without changing callers.

Add tests covering explicit encodings, wildcard matching, quality
values, identity encoding, and the case where no encoding is
acceptable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 00:00:37 +02:00
Paweł Gronowski 98d4cd6551 daemon: Pass context through container kill operations
Drop cancellation at the kill boundary because killing starts
irreversible task and cleanup work that must finish after request
cancellation.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-27 19:11:36 +02:00
Sebastiaan van Stijn 74364ae3d2 daemon/server: fix perfsprint linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-07-06 15:36:17 +02:00
Paweł Gronowski dc97f25cbf daemon/router: Gate ContainerUpdate blkio device fields by API version
ContainerUpdate only starts applying per-device blkio settings in the
current API version.

The fields existed in the Go request type before that because it shares
`container.Resources` with other endpoints, but they were not documented
as supported for container update and older daemons ignored them.

Clear these fields when handling requests for older API versions so
clients pinned to those versions keep the previous behavior, while v1.55
clients can use the newly supported fields.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-06-12 15:52:31 +02:00
Paweł Gronowski 5eda928bb8 Merge pull request #52636 from smerkviladze/add-attestation-statements
image: expose in-toto attestation statements via the API
2026-06-12 15:49:34 +02:00
Sopho Merkviladze 0b2c3780be api: declare ImageAttestations platform and type as repeatable
Both query parameters are now collectionFormat: multi arrays in the
swagger so they can accept multiple values later without an API
version bump. The server still operates on a single platform and
rejects requests passing more than one; type is read directly as a
list of repeated values instead of a comma-separated string.

Signed-off-by: Sopho Merkviladze <smerkviladze@mirantis.com>
2026-06-12 16:20:52 +04:00
Sopho Merkviladze a0b6dbc2fc api: add GET /images/{name}/attestations endpoint
Add a new Engine API endpoint that returns the in-toto attestation
statements attached to an image for a given platform. The endpoint
locates the attestation manifest(s) referencing the requested platform's
image manifest, enumerates the statement layers, and returns each
layer's OCI descriptor (including media type, digest, size, and
annotations) together with its in-toto predicate type.

Query parameters:
  - platform: JSON-encoded OCI platform; defaults to the daemon's host
    platform if omitted.
  - type: comma-separated list of in-toto predicate type URIs; if
    omitted, all statements are returned.
  - statement: boolean, defaults to false. When true, the daemon reads
    each matching statement blob and includes the verbatim in-toto JSON
    in the response. When false (or omitted), statement blobs are not
    read and the Statement field is absent from each entry.

The manifest-chain walk (locating the platform image manifest and its
associated attestation manifest) is delegated to policy-helpers'
image.ResolveSignatureChain so that moby and BuildKit agree on how to
interpret the attestation storage format. The statement-layer iteration
and blob reading is inlined: when statement bodies are requested it
fails fast on the first unreadable blob and reads matching blobs
eagerly into memory; otherwise statement-layer blobs are never read
from the content store.

The endpoint is implemented for the containerd image store. The legacy
graphdriver store returns errdefs.NotImplemented (HTTP 501).

Signed-off-by: Sopho Merkviladze <smerkviladze@mirantis.com>
2026-06-12 13:40:58 +04:00
Akihiro Suda efe6156e19 daemon: allow RawSysInfo to return an error
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-06-11 17:39:03 +09:00
Sebastiaan van Stijn d92a8c97de container/logs: add support for JSON streams (experimental)
This adds support for streaming logs as JSON stream either through an
"Accept" header ("application/jsonl", "application/x-ndjson", or
"application/json-seq"), or through a `format=json` query variable.

By default log messages are included as UTF-8 encoded strings, which should
work for regular logs, but can be lossy.

```bash
docker rm -fv my-container3
docker run \
    -qit \
    --name my-container3 \
    --label=labelA=foo \
    --label=labelB=bar \
    --log-opt labels=labelA,labelB \
    ubuntu bash
```

Inside the container:

```bash
root@b36bfcd439e9:/# echo {1..9} && exit
1 2 3 4 5 6 7 8 9
exit
```

With the message encoded as utf-8;

```bash
curl -s --unix-socket /var/run/docker.sock 'http://localhost/v1.54/containers/my-container3/logs?stdout=1&stderr=1&format=json' | jq .
{
  "Line": "\u001b[?2004h\u001b]0;root@1065b85dd167: /\u0007root@1065b85dd167:/# \u001b[7mecho {1..9} && exit\u001b[27m\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\becho {1..9} && exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.083531419Z"
}
{
  "Line": "\u001b[?2004l\r1 2 3 4 5 6 7 8 9\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088152377Z"
}
{
  "Line": "exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088183336Z"
}
```

With `details` enabled;

```bash
curl -s --unix-socket /var/run/docker.sock 'http://localhost/v1.54/containers/my-container3/logs?stdout=1&stderr=1&format=json&details=1' | jq .
{
  "Line": "\u001b[?2004h\u001b]0;root@1065b85dd167: /\u0007root@1065b85dd167:/# \u001b[7mecho {1..9} && exit\u001b[27m\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\becho {1..9} && exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.083531419Z",
  "Attrs": [{"Key": "labelA","Value": "foo"},{"Key": "labelB","Value": "bar"}]
}
{
  "Line": "\u001b[?2004l\r1 2 3 4 5 6 7 8 9\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088152377Z",
  "Attrs": [{"Key": "labelA","Value": "foo"},{"Key": "labelB","Value": "bar"}]
}
{
  "Line": "exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088183336Z",
  "Attrs": [{"Key": "labelA","Value": "foo"},{"Key": "labelB","Value": "bar"}]
}
```

Using `Accept` header instead of the `format=json` query parameter;

```bash
curl -s -H 'Accept: application/json-seq' --unix-socket /var/run/docker.sock 'http://localhost/v1.54/containers/my-container3/logs?stdout=1&stderr=1' | jq .
{
  "Line": "\u001b[?2004h\u001b]0;root@1065b85dd167: /\u0007root@1065b85dd167:/# \u001b[7mecho {1..9} && exit\u001b[27m\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\becho {1..9} && exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.083531419Z"
}
{
  "Line": "\u001b[?2004l\r1 2 3 4 5 6 7 8 9\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088152377Z"
}
{
  "Line": "exit\r\n",
  "Source": "stdout",
  "Timestamp": "2026-02-20T15:39:01.088183336Z"
}
```

Metadata about partial messages is included (except for the json-file logging
driver, which doesn't use it currently);

The partial messages also don't get a trailing newline, except for the last entry;

```bash
docker run --name bar alpine sh -c 'head -c 20000 /dev/zero | tr "\0" A; echo'
curl -s --unix-socket /var/run/docker.sock 'http://localhost/v1.54/containers/bar/logs?stdout=1&stderr=1&format=json'
{"Line":"AAAAAAAAAA....AAAA","Source":"stdout","Timestamp":"2026-02-21T21:45:47.075093919Z"}
{"Line":"AAAAAAAAAAAAAAAA\n","Source":"stdout","Timestamp":"2026-02-21T21:45:47.075093919Z"}
```

And for logging drivers other than the `json-file`, we have information about
partials in a slightly more structured format:

```bash
docker run --name baz --log-driver=local alpine sh -c 'head -c 20000 /dev/zero | tr "\0" A; echo'
curl -s --unix-socket /var/run/docker.sock 'http://localhost/v1.54/containers/baz/logs?stdout=1&stderr=1&format=json'
{"Line":"AAAAAAAAAA....ASAA","Source":"stdout","Timestamp":"2026-02-21T21:49:42.453363584Z","LogMetaData":{"Last":false,"ID":"46a9188a552a068c1d63a5096b7335788aea7e430817f3d2d83c5fd90c6365ef","Ordinal":1}}
{"Line":"AAAAAAAAAAAAAAAA\n","Source":"stdout","Timestamp":"2026-02-21T21:49:42.453363584Z","LogMetaData":{"Last":true,"ID":"46a9188a552a068c1d63a5096b7335788aea7e430817f3d2d83c5fd90c6365ef","Ordinal":2}}
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-05-07 21:40:52 +02:00
Vedant Madane 70ac493e97 server/router/build: replace output buffering workaround with EnableFullDuplex
The wrapOutputBufferedUntilRequestRead helper was added as a workaround
for Go not supporting full-duplex HTTP/1 responses (golang/go#15527,
golang/go#22209). Since Go 1.21, the standard library ships
http.ResponseController.EnableFullDuplex which tells the server that
the handler will interleave reads and writes, making the buffering
wrap unnecessary.

Replace the workaround with a single EnableFullDuplex call and remove
the helper types (wcf, rcNotifier, flusher, nopFlusher) that were only
used by the old path.

Fixes #51209

Signed-off-by: Vedant Madane <vedant.madane@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-05-07 01:34:39 +02:00
Ogulcan Aydogan 735d17e1a5 fix: return 400 instead of 500 for invalid request parameters
Wrap plain errors with errdefs.InvalidParameter so the API returns
HTTP 400 instead of 500 for user input errors:

- image export: invalid reference format
- container stop/list: invalid integer for t/limit params
- plugin privileges: invalid reference format
- plugin enable: invalid integer for timeout param
- service/task logs: missing stdout/stderr stream selection

Fixes #48173

Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
2026-04-01 18:10:28 +02:00
Paweł Gronowski b77af956b1 Merge pull request #52094 from thaJeztah/backend_log_opts
daemon/server: improve parsing timestamps and move it to the router
2026-04-01 13:17:42 +02:00
Sebastiaan van Stijn b24c8272e5 go fix "omitempty"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 23:24:53 +01:00
Paweł Gronowski 2fa6029be4 network/connect: Support MacAddress
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-03-05 14:11:08 +01:00
Sebastiaan van Stijn f401a9678b daemon/server/backend: ContainerLogsOptions: use time.Time for since, until
Move parsing the wire format to the router instead of in the daemon, so
that a strong type can be used internally.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-03 21:53:23 +01:00
Sebastiaan van Stijn 210cdcbd46 daemon/server/router: fix "no stream selected" error and status
Tweak the wording, and make sure we return a 400 status, not a 500

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-03 21:53:23 +01:00
Sebastiaan van Stijn 568312cb85 daemon/internal/timestamp: replace ParseTimestamps with ParseUnixTimestamp
Return a time.Time instead of splitting to seconds/nanoseconds.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-03 21:53:23 +01:00
Sebastiaan van Stijn 8f8b23c729 daemon: fix some untyped "invalid parameter" errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-03 20:30:24 +01:00
Paweł Gronowski 11d1267e88 Merge pull request #52030 from crazy-max/image-list-identity
image: add opt-in identity field to image list API for containerd backend
2026-02-27 18:31:01 +00:00
Sebastiaan van Stijn 52dc67c0df Merge pull request #52067 from cpuguy83/restore_older_apis
Add compatibility with API v1.40 and up
2026-02-27 18:07:02 +01:00
CrazyMax 6d133c5ec6 image: add opt-in identity support to image list API
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-27 16:35:31 +01:00
Sebastiaan van Stijn a49c2f66db Merge pull request #52083 from thaJeztah/negotiate
api: improve, fix content-negotiation for /events endpoint
2026-02-24 19:46:33 +01:00
Sebastiaan van Stijn d593a7b427 daemon/server/httputils: move WriteLogStream to its own package
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-24 14:18:38 +01:00
Sebastiaan van Stijn 35fdcb802c api: improve, fix content-negotiation for /events endpoint
Commits df506c107e and aef5d996ce
fixed the content-type advertised by the `/events` endpoint, and added content
negotiation as an "opt-in" by clients.

A fallback / default value was added to keep the old (`application/json`)
content type, however, some clients may send `*/*` as a default, which
would considered as "opt-in" in the negotiation, and pick the first "offer"
(`application/jsonl`) instead of the fallback.

On docker 28.x and lower, omitting an `Accept` header, or sending `*/*`
would produce the `application/json` content-type:

```
curl -sS -D - --unix-socket /var/run/docker.sock 'http://localhost/v1.50/events?until=1' | grep 'Content-Type'

curl -sS -D - -H 'Accept: */*' --unix-socket /var/run/docker.sock 'http://localhost/v1.50/events?until=1' | grep 'Content-Type'
```

On docker 29.x, a missing accept header, or a `*/*` would use the new content-type,
not the previous default;

```
curl -sS -D - --unix-socket /var/run/docker.sock 'http://localhost/v1.50/events?until=1' | grep 'Content-Type'

curl -sS -D - -H 'Accept: */*' --unix-socket /var/run/docker.sock 'http://localhost/v1.50/events?until=1' | grep 'Content-Type'
```

With this patch, the default depends on the API version, and we only
override the content-type if there's a match with any of the types
set in the `Accept` header, ignoring wildcards (`*/*`) that are sent
as default by some clients, such as cURL or `docker-py`;

```
curl -sS -D - --unix-socket /var/run/docker.sock 'http://localhost/v1.51/events?until=1' | grep 'Content-Type'

curl -sS -D - -H 'Accept: */*' --unix-socket /var/run/docker.sock 'http://localhost/v1.51/events?until=1' | grep 'Content-Type'

curl -sS -D - --unix-socket /var/run/docker.sock 'http://localhost/v1.52/events?until=1' | grep 'Content-Type'
Content-Type: application/jsonl

curl -sS -D - -H 'Accept: */*' --unix-socket /var/run/docker.sock 'http://localhost/v1.52/events?until=1' | grep 'Content-Type'

curl -sS -D - -H 'Accept: application/json-seq' --unix-socket /var/run/docker.sock 'http://localhost/v1.50/events?until=1' | grep 'Content-Type'
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-23 13:15:52 +01:00
Sebastiaan van Stijn dff0d87430 daemon/server/httputils: contenttype package and MatchAcceptStrict utility
This allows negotiating the content-type without wildcard-matching.
In most of our uses, we want to provide the best match that the
client accepts, but have to avoid picking the first match if a
client would send "*/*" (or, e.g., "application/*").

For example, the events endpoint added support for JSON-stream
content types, but older API versions unconditionally returned
"application/json". Clients sending "*/*" (such as docker/docker-py)
would now get a different content type as before.

For convenience, also adding a wrapper for the gddo NegotiateContentType
utility with a slightly different signature (accepting just the headers
instead of the whole request).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-23 13:13:39 +01:00
Brian Goff f96921e5e5 api: lower default minimum API version to v1.40
Extend the previous commit to support API v1.40 (Docker 19.03) by
lowering defaultMinAPIVersion and client MinAPIVersion from 1.41 to
1.40.

Reject container create requests that set the HostConfig.Capabilities
field on API v1.40, since this daemon can no longer honor it. The field
was removed before API v1.41 (24f173a003) and the Go type no longer
includes it, so without this check the field would be silently dropped.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2026-02-19 14:54:56 -08:00
Brian Goff e2fad779f7 api: restore support for API v1.41, v1.42, and v1.43
Lower the default minimum API version from v1.44 to v1.41, restore
VirtualSize in image list and disk usage responses for API < 1.44, and
add version-gated skips for integration tests that need newer APIs.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2026-02-19 14:54:44 -08:00
Paweł Gronowski 45aee529d2 Merge pull request #51862 from thaJeztah/identity_version_gate
inspect: add API-version gate for image identity
2026-01-26 17:08:02 +00:00
Sebastiaan van Stijn 3abbf46a6b daemon/server/backend: ContainerListOptions: remove unused Before and Since
The `Before` and `Since` options were used for the `before` and `since`
query parameters. These parameters were replaced with the `before` and
`since` filters in docker 1.10.0 through [moby@1921c62], and [moby@b41dba5].

The query parameters were removed from the CLI and daemon in docker 1.12.0
through [moby@91b7157], however the fields themselves were never removed.

This patch removes the fields from the backend. Removal from the client will
require a deprecation, and will be handled separately.

[moby@1921c62]: https://github.com/moby/moby/commit/1921c629381d25ebff7b8b8c8348a0a81525f264
[moby@b41dba5]: https://github.com/moby/moby/commit/b41dba58a01855e0d222bd6c14af9874c298c154
[moby@91b7157]: https://github.com/moby/moby/commit/91b715706493059d39c9f8b1d01c9d80ce1799d9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-20 12:18:35 +01:00
Sebastiaan van Stijn 26d292b3e4 inspect: add API-version gate for image identity
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-16 18:17:14 +01:00
Nicolas De Loof aef5d996ce use mime-type application/jsonl to align with openapi 3.2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-17 11:37:48 +01:00
Paweł Gronowski 1489cb3ae0 Merge pull request #51722 from vvoland/modernize
Modernize Go code
2025-12-16 12:38:36 +00:00
Paweł Gronowski 5d716f20a3 Merge pull request #51721 from vvoland/deprecate-grpc
api: deprecate /grpc and /session endpoints
2025-12-16 12:34:55 +00:00
Rob Murray 1e209e788b Continue to backfill empty PortBindings in API 1.53
- introduced by commit 0ca7ac3 ("daemon: backfill empty PBs
  slices for backward compat")

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-16 11:03:58 +00:00
Paweł Gronowski cdce8f4f92 modernize: Use maps.Copy instead of for loops
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Paweł Gronowski f44b5abf0e api: deprecate /grpc and /session endpoints
The /grpc and /session endpoints are now deprecated as the Engine has
been upgraded to properly support HTTP/2 and h2c requests, making these
specialized endpoints unnecessary.

These endpoints will be removed in the next major API version to
complete the cleanup.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:44:22 +01:00
Rob Murray 7c7a626e5d NRI: include in API Info response
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-15 10:36:05 +00:00
Sebastiaan van Stijn 0af2962fdd daemon: reduce use of pointer-slices in backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 20:52:15 +01:00
Paweł Gronowski f57da07056 Merge pull request #51454 from thaJeztah/api_volumes_no_pointer
api/types/volume: change ListResponse.Volumes to a non-pointer slice
2025-11-10 16:20:16 +01:00
Rob Murray 69c4524355 Merge pull request #51437 from thaJeztah/diskusage_move_legacy
api: remove / internalize LegacyDiskUsage
2025-11-10 15:03:37 +00:00
Sebastiaan van Stijn 18000fe371 api/types/volume: change ListResponse.Volumes to a non-pointer slice
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 13:13:22 +01:00
Albin Kerouanton d087d3c057 daemon: close EventsService on shutdown
On daemon shutdown, the HTTP server tries to gracefully shutdown for 5
seconds. If there's an open API connection to the '/events' endpoint, it
fails to do so as nothing interrupts that connection, thus forcing the
daemon to wait until that timeout is reached.

Add a Close method to the EventsService, and call it during daemon
shutdown. It'll close any events channel, signaling to the '/events'
handler to return and close the connection.

It now takes ~1s (or less) to shutdown the daemon when there's an active
'/events' connection, instead of 5.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-09 22:38:59 +01:00
Sebastiaan van Stijn ed428234bd api: remove / internalize LegacyDiskUsage
These fields have been removed from the API specification, and the struct
was only needed to produce legacy responses (server), or to unmarshal
legacy responses in the client.

As the API module only provides API definitions for the current API version,
we should remove these legacy structs, and keep them internal to the daemon
and client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 20:16:03 +01:00
Sebastiaan van Stijn 71bcd22d6d daemon/server/router/system: simplify constructing response
Now that we separated the legacy response from non-legacy responses,
we can consume the data produced by the backend as-is; the backend
takes care of omitting "verbose" data (leaving the `Items` slices
empty), and with an early return for the legacy responses, we won't
end up with returning _both_ responses on API < v1.52, but (TBD) still
return both responses for API v1.52.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:40 +01:00
Sebastiaan van Stijn f5e319c950 daemon/server/router/system: use early return for disk-usage
Use early return for legacy response. When using API < v1.52, we'd
never return the new fields, so we can return early, and produce the
legacy-fields only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:39 +01:00
Sebastiaan van Stijn 0dcb1fe344 daemon: align build.DiskUsage() with other disk-usages
Move calculation of the data to the builder backend, to align with
the other type of objects. This also allows us to skip the verbose
data if it's not used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:30 +01:00