summaryrefslogtreecommitdiff
path: root/api
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #45469 from thaJeztah/deprecate_virtualsize_STEP2Akihiro Suda2023-05-165-27/+17
|\ | | | | API: omit deprecated VirtualSize field for API v1.44 and up
| * API: omit deprecated VirtualSize field for API v1.44 and upSebastiaan van Stijn2023-05-065-27/+17
| | | | | | | | | | | | | | | | This field is deprecated since 1261fe69a3586bb102182aa885197822419c768c, and will now be omitted on API v1.44 and up for the `GET /images/json`, `GET /images/{id}/json`, and `GET /system/df` endpoints. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #45484 from thaJeztah/remove_deprecated_stubsSebastiaan van Stijn2023-05-122-13/+0
|\ \ | | | | | | remove deprecated types, fields, and functions
| * | api/types/container: remove deprecated ContainerChangeResponseItemSebastiaan van Stijn2023-05-061-6/+0
| | | | | | | | | | | | | | | | | | | | | This was deprecated in dbb48e4b29e124aef6716ee8ad6856bf696235ca, which is part of the v24.0.0 release, so we can remove it from master. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * | api/types: remove deprecated AuthConfigSebastiaan van Stijn2023-05-061-7/+0
| |/ | | | | | | | | | | | | This was deprecated in 818ee962196d668b6d405835c88c1ac6cdab7423, which is part of the v24.0.0 release, so we can remove it from master. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | fixing consistent aliases for OCI spec importsJeyanthinath Muthuram2023-05-088-21/+21
|/ | | | Signed-off-by: Jeyanthinath Muthuram <jeyanthinath10@gmail.com>
* API: bump version to 1.44Sebastiaan van Stijn2023-05-062-5/+5
| | | | | | | The 24.0 branch was created, so changes in master/main should now be targeting the next version of the API (1.44). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* api: synchronize api/swagger.yaml with docs/api/v1.43.yamlSebastiaan van Stijn2023-05-051-0/+8
| | | | | | | | | | | | - forward-port changes from 0ffaa6c7858f0a5d85318efda43a2d20a684eae2 to api/swagger.yaml (v1.44-dev) - backports the changes to v1.43; - Update container OOMKilled flag immediately 57d2d6ef621cc126ca904e8fc98fbacbd345790a - Add no-new-privileges to SecurityOptions returned by /info eb7738221c3b6a6a1c1f46e4f38357473feddfc4 - API: deprecate VirtualSize field for /images/json and /images/{id}/json 1261fe69a3586bb102182aa885197822419c768c - api/types/container: create type for changes endpoint dbb48e4b29e124aef6716ee8ad6856bf696235ca - builder-next/prune: Handle "until" filter timestamps 54a125f67703ab51ed8a004b625439dfafa7aa6c Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Merge pull request #45353 from thaJeztah/api_container_change_typeSebastiaan van Stijn2023-05-046-39/+95
|\ | | | | api/types/container: create type for changes endpoint
| * api/types/container: create type for changes endpointSebastiaan van Stijn2023-05-036-39/+95
| | | | | | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | api/server/router/container: containerRouter.postCommit: inline structSebastiaan van Stijn2023-04-291-4/+2
| | | | | | | | | | | | Remove intermediate variable and inline the struct-literal. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #45314 from corhere/graceful-shutdownSebastiaan van Stijn2023-04-281-80/+3
|\ \ | | | | | | cmd/dockerd: gracefully shut down the API server
| * | cmd/dockerd: gracefully shut down the API serverCory Snider2023-04-261-80/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of Go 1.8, "net/http".Server provides facilities to close all listeners, making the same facilities in server.Server redundant. http.Server also improves upon server.Server by additionally providing a facility to also wait for outstanding requests to complete after closing all listeners. Leverage those facilities to give in-flight requests up to five seconds to finish up after all containers have been shut down. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | Use the image service instead of the reference store for taggingDjordje Lukic2023-04-261-1/+1
|/ / | | | | | | | | | | | | | | The image store sends events when a new image is created/tagged, using it instead of the reference store makes sure we send the "tag" event when a new image is built using buildx. Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
* | builder-next/prune: Handle "until" filter timestampsPaweł Gronowski2023-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes `docker system prune --filter until=<timestamp>`. `docker system prune` claims to support "until" filter for timestamps, but it doesn't work because builder "until" filter only supports duration. Use the same filter parsing logic and then convert the timestamp to a relative "keep-duration" supported by buildkit. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
* | API: deprecate VirtualSize field for /images/json and /images/{id}/jsonSebastiaan van Stijn2023-04-184-26/+18
| | | | | | | | | | | | | | | | | | In versions of Docker before v1.10, this field was calculated from the image itself and all of its parent images. Images are now stored self-contained, and no longer use a parent-chain, making this field an equivalent of the Size field. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #45320 from akerouanton/info-no-new-privilegesSebastiaan van Stijn2023-04-181-1/+2
|\ \ | |/ |/| Add no-new-privileges to SecurityOptions returned by /info
| * Add no-new-privileges to SecurityOptions returned by /infoAlbin Kerouanton2023-04-181-1/+2
| | | | | | | | Signed-off-by: Albin Kerouanton <albinker@gmail.com>
* | api/server: getImagesJSON(): don't check version in a loopSebastiaan van Stijn2023-04-171-1/+2
| | | | | | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #45300 from thaJeztah/errdefs_aliasSebastiaan van Stijn2023-04-131-7/+7
|\ \ | |/ |/| use consistent alias for containerd's errdefs package, and validate in CI
| * use consistent alias for containerd's errdefs packageSebastiaan van Stijn2023-04-081-7/+7
| | | | | | | | | | | | | | | | | | | | The signatures of functions in containerd's errdefs packages are very similar to those in our own, and it's easy to accidentally use the wrong package. This patch uses a consistent alias for all occurrences of this import. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #44510 from thaJeztah/api_server_sanitizeRepoAndTagsSebastiaan van Stijn2023-04-121-11/+5
|\ \ | |/ |/| api/server/backend/build: sanitizeRepoAndTags() check for digest
| * api/server/backend/build: sanitizeRepoAndTags() check for digestSebastiaan van Stijn2022-11-241-11/+5
| | | | | | | | | | | | | | | | The reference.ParseNormalizedNamed() utility already returns a Named reference, but we're interested in wether the digest has a digest, so check for that. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #44963 from vvoland/c8d-push-upstreamTianon Gravi2023-03-302-2/+20
|\ \ | | | | | | c8d: Implement push
| * | images/push: Accept referencePaweł Gronowski2023-03-302-2/+20
| | | | | | | | | | | | | | | | | | | | | Push the reference parsing from repo and tag names into the api and pass a reference object to the ImageService. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
* | | c8d: add support for `docker diff`Laura Brehm2023-03-302-2/+2
|/ / | | | | | | Signed-off-by: Laura Brehm <laurabrehm@hey.com>
* | registry/search: pass User-Agent through headersSebastiaan van Stijn2023-03-212-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3991faf4640a46412a8af000ede78fc5cba76d0a moved search into the registry package, which also made the `dockerversion` package a dependency for registry, which brings additional (indirect) dependencies, such as `pkg/parsers/kernel`, and `golang.org/x/sys/windows/registry`. Client code, such as used in docker/cli may depend on the `registry` package, but should not depend on those additional dependencies. This patch moves setting the userAgent to the API router, and instead of passing it as a separate argument, includes it into the "headers". As these headers now not only contain the `X-Meta-...` headers, the variables were renamed accordingly. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | api/types/container: IpcMode: use common function for container-modeSebastiaan van Stijn2023-03-151-6/+5
| | | | | | | | | | | | | | | | Use the utility introduced in 1bd486666b858c11451495c9eb803eda3184e58c to share the same implementation as similar options. The IPCModeContainer const is left for now, but we need to consider what to do with these. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | api/types/container: PidMode: fix validation for empty container name/IDSebastiaan van Stijn2023-03-152-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e7d75c8db7da8be0ae45a1abba5652658c536a2a fixed validation of "host" mode values, but also introduced a regression for validating "container:" mode PID-modes. PID-mode implemented a stricter validation than the other options and, unlike the other options, did not accept an empty container name/ID. This feature was originally implemented in fb43ef649bc6aa11ca19c0e046518e85e1c7e2fa, added some some integration tests (but no coverage for this case), and the related changes in the API types did not have unit-tests. While a later change (d4aec5f0a680b6b01bb720830451a93c6ec398e6) added a test for the `--pid=container:` (empty name) case, that test was later migrated to the CLI repository, as it covered parsing the flag (and validating the result). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | api/types/container: fix .Container() returning a name, when it shouldn'tSebastiaan van Stijn2023-03-152-36/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 1bd486666b858c11451495c9eb803eda3184e58c refactored this code, but it looks like I removed some changes in this part of the code when extracting these changes from a branch I was working on, and the behavior did not match the function's description (name to be empty if there is no "container:" prefix Unfortunately, there was no test coverage for this in this repository, so we didn't catch this. This patch: - fixes containerID() to not return a name/ID if no container: prefix is present - adds test-coverage for TestCgroupSpec - adds test-coverage for NetworkMode.ConnectedContainer - updates some test-tables to remove duplicates, defaults, and use similar cases Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | api/types/container: put "valid" field as first check in testsSebastiaan van Stijn2023-03-151-43/+43
| | | | | | | | | | | | | | | | | | Make if more explicit which test-cases should be valid, and make it the first field, because the "valid" field is shared among all test-cases in the test-table, and making it the first field makes it slightly easier to distinguish valid from invalid cases. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #45086 from corhere/search-in-registry-serviceBjorn Neergaard2023-03-153-4/+9
|\ \ | | | | | | Move filtered registry search out of the image service
| * | Move filtered registry search out of image serviceCory Snider2023-03-103-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SearchRegistryForImages does not make sense as part of the image service interface. The implementation just wraps the search API of the registry service to filter the results client-side. It has nothing to do with local image storage, and the implementation of search does not need to change when changing which backend (graph driver vs. containerd snapshotter) is used for local image storage. Filtering of the search results is an implementation detail: the consumer of the results does not care which actor does the filtering so long as the results are filtered as requested. Move filtering into the exported API of the registry service to hide the implementation details. Only one thing---the registry service implementation---would need to change in order to support server-side filtering of search results if Docker Hub or other registry servers were to add support for it to their APIs. Use a fake registry server in the search unit tests to avoid having to mock out the registry API client. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | volumes: fix error-handling when removing volumes with swarm enabledSebastiaan van Stijn2023-03-131-14/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3246db3755698455740c812c6477f43e74924fa7 added handling for removing cluster volumes, but in some conditions, this resulted in errors not being returned if the volume was in use; docker swarm init docker volume create foo docker create -v foo:/foo busybox top docker volume rm foo This patch changes the logic for ignoring "local" volume errors if swarm is enabled (and cluster volumes supported). While working on this fix, I also discovered that Cluster.RemoveVolume() did not handle the "force" option correctly; while swarm correctly handled these, the cluster backend performs a lookup of the volume first (to obtain its ID), which would fail if the volume didn't exist. Before this patch: make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration ... Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m -test.run TestVolumesRemoveSwarmEnabled ... === RUN TestVolumesRemoveSwarmEnabled === PAUSE TestVolumesRemoveSwarmEnabled === CONT TestVolumesRemoveSwarmEnabled === RUN TestVolumesRemoveSwarmEnabled/volume_in_use volume_test.go:122: assertion failed: error is nil, not errdefs.IsConflict volume_test.go:123: assertion failed: expected an error, got nil === RUN TestVolumesRemoveSwarmEnabled/volume_not_in_use === RUN TestVolumesRemoveSwarmEnabled/non-existing_volume === RUN TestVolumesRemoveSwarmEnabled/non-existing_volume_force volume_test.go:143: assertion failed: error is not nil: Error response from daemon: volume no_such_volume not found --- FAIL: TestVolumesRemoveSwarmEnabled (1.57s) --- FAIL: TestVolumesRemoveSwarmEnabled/volume_in_use (0.00s) --- PASS: TestVolumesRemoveSwarmEnabled/volume_not_in_use (0.01s) --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume (0.00s) --- FAIL: TestVolumesRemoveSwarmEnabled/non-existing_volume_force (0.00s) FAIL With this patch: make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration ... Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m -test.run TestVolumesRemoveSwarmEnabled ... make TEST_FILTER=TestVolumesRemoveSwarmEnabled DOCKER_GRAPHDRIVER=vfs test-integration ... Running /go/src/github.com/docker/docker/integration/volume (arm64.integration.volume) flags=-test.v -test.timeout=10m -test.run TestVolumesRemoveSwarmEnabled ... === RUN TestVolumesRemoveSwarmEnabled === PAUSE TestVolumesRemoveSwarmEnabled === CONT TestVolumesRemoveSwarmEnabled === RUN TestVolumesRemoveSwarmEnabled/volume_in_use === RUN TestVolumesRemoveSwarmEnabled/volume_not_in_use === RUN TestVolumesRemoveSwarmEnabled/non-existing_volume === RUN TestVolumesRemoveSwarmEnabled/non-existing_volume_force --- PASS: TestVolumesRemoveSwarmEnabled (1.53s) --- PASS: TestVolumesRemoveSwarmEnabled/volume_in_use (0.00s) --- PASS: TestVolumesRemoveSwarmEnabled/volume_not_in_use (0.01s) --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume (0.00s) --- PASS: TestVolumesRemoveSwarmEnabled/non-existing_volume_force (0.00s) PASS Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | remove GetLayerByID from ImageService interfaceNicolas De Loof2023-03-102-2/+2
| | | | | | | | | | | | Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com> Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | c8d: Compute container's layer sizeLaura Brehm2023-03-082-2/+2
| | | | | | | | | | Co-authored-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Laura Brehm <laurabrehm@hey.com>
* | Merge pull request #45032 from corhere/shim-optsSebastiaan van Stijn2023-03-021-3/+9
|\ \ | | | | | | daemon: allow shimv2 runtimes to be configured
| * | daemon: allow shimv2 runtimes to be configuredCory Snider2023-02-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kubernetes only permits RuntimeClass values which are valid lowercase RFC 1123 labels, which disallows the period character. This prevents cri-dockerd from being able to support configuring alternative shimv2 runtimes for a pod as shimv2 runtime names must contain at least one period character. Add support for configuring named shimv2 runtimes in daemon.json so that runtime names can be aliased to Kubernetes-compatible names. Allow options to be set on shimv2 runtimes in daemon.json. The names of the new daemon runtime config fields have been selected to correspond with the equivalent field names in cri-containerd's configuration so that users can more easily follow documentation from the runtime vendor written for cri-containerd and apply it to daemon.json. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | Merge pull request #45088 from corhere/make-apiserver-less-weirdCory Snider2023-03-011-15/+2
|\ \ \ | | | | | | | | api/server: delete Wait method
| * | | api/server: delete Wait methodCory Snider2023-03-011-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's surprising that the method to begin serving requests is named Wait. And it is unidiomatic: it is a synchronous call, but it sends its return value to the channel passed in as an argument instead of just returning the value. And ultimately it is just a trivial wrapper around serveAPI. Export the ServeAPI method instead so callers can decide how to call and synchronize around it. Call ServeAPI synchronously on the main goroutine in cmd/dockerd. The goroutine and channel which the Wait() API demanded are superfluous after all. The notifyReady() call was always concurrent and asynchronous with respect to serving the API (its implementation spawns a goroutine) so it makes no difference whether it is called before ServeAPI() or after `go ServeAPI()`. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | | Merge pull request #45083 from corhere/unused-api-config-structCory Snider2023-03-012-26/+1
|\ \ \ \ | |/ / / |/| | | api/server: drop unused Config struct
| * | | api/server: drop unused Config structCory Snider2023-02-282-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Server.cfg field is never referenced by any code in package "./api/server". "./api/server".Config struct values are used by DaemonCli code, but only to pass around configuration copied out of the daemon config within the "./cmd/dockerd" package. Delete the "./api/server".Config struct definition and refactor the "./cmd/dockerd" package to pull configuration directly from cli.Config. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | | api: Remove <none> in Repo(Tags|Digests) for >= 1.43Paweł Gronowski2023-02-271-3/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Deprecate `<none>:<none>` and `<none>@<none>` magic strings included in `RepoTags` and `RepoDigests`. Produce an empty arrays instead and leave the presentation of untagged/dangling images up to the client. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
* | | Merge pull request #45025 from corhere/oci-annotation-passthruBrian Goff2023-02-242-10/+16
|\ \ \
| * | | daemon: add annotations to container HostConfigCory Snider2023-02-232-10/+16
| |/ / | | | | | | | | | | | | | | | | | | Allow clients to set annotations on a container which will applied to the container's OCI spec. Signed-off-by: Cory Snider <csnider@mirantis.com>
* | | Merge pull request #44840 from vvoland/c8d-list-dangling-upstreamBjorn Neergaard2023-02-231-0/+7
|\ \ \ | | | | | | | | c8d/list: Fix Repo(Digests|Tags) for untagged images
| * | | api: Move Repo(Digests|Tags) <none> fallback from daemonPaweł Gronowski2023-02-221-0/+7
| | | | | | | | | | | | | | | | Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
* | | | Merge pull request #44003 from vvoland/invalidfilterBrian Goff2023-02-223-11/+187
|\ \ \ \ | |/ / / |/| | |
| * | | api/types/filters: Add GetBoolOrDefaultPaweł Gronowski2023-01-263-11/+187
| | | | | | | | | | | | | | | | Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
* | | | chore: use http constants to replace numbersxin.li2023-02-211-6/+6
| |/ / |/| | | | | | | | Signed-off-by: xin.li <xin.li@daocloud.io>