Commit Graph

2044 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 43b840ed93
vendor: github.com/docker/docker a736d0701c41 (master, v27.0.0-dev)
full diff: 59996a493c...a736d0701c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 17:41:09 +02:00
Sebastiaan van Stijn c481c64922
cli/command: remove some import aliases
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 16:59:21 +02:00
Sebastiaan van Stijn 851277f966
cli/command/container: rename some variables
Rename some variables to prevent shadowing and for clarity.
Also made some minor formatting changes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 16:59:21 +02:00
Sebastiaan van Stijn 1a83595c7c
cli/command/container: legacyWaitExitOrRemoved rm intermediate var
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 16:59:20 +02:00
Sebastiaan van Stijn 0d4de2392b
cli/command/container: inline some variables to prevent shadowing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 16:59:20 +02:00
Alano Terblanche 6b58179017
Merge pull request #4993 from Benehiko/hoist-signal-from-prompt
feat: global signal handling to cancel ctx for graceful exits
2024-06-10 13:44:24 +02:00
Nick Sieger d0057db3ac
cli/command: more go1.19 ("predeclared any")
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2024-06-07 11:56:46 -05:00
Alano Terblanche 3f0d90a2a9
feat: global signal handling with context cancellation
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2024-06-07 16:56:34 +02:00
Sebastiaan van Stijn 97b7746df0
vendor: github.com/docker/docker 59996a493cfc (v27.0.0-dev)
full diff: 181e70cc07...59996a493c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-07 16:11:03 +02:00
Laura Brehm 482bf8613c
Merge pull request #5125 from robmry/stack_deploy_service_driver_opts
Handle networks.driver_opts for a service
2024-06-07 11:23:07 +01:00
Rob Murray 94f9de5928 Handle networks.driver_opts for a service
These are endpoint-specific driver options...

services:
  myservice:
    image: myimage
    networks:
      mynet:
        driver_opts:
          "option1": "value1"

The API has had support for a long time, it's only recently been
added to compose (unreleased right now).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-06-07 08:20:43 +00:00
Rob Murray a731722652 cli/compose: add schema 3.13 (no changes from 3.12 yet)
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-06-07 08:20:43 +00:00
Sebastiaan van Stijn 0502189e28
cli/command/network: add minimal test for --ipv6 option
Add a minimal test to verify values are handled correctly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-07 10:10:15 +02:00
Albin Kerouanton db2672e685 network create: make --ipv6 optional
The API field `EnableIPv6` was marked as optional in our Swagger docs,
and its default value in the Go client came from that field being a
bool, thus defaulting to its zero value. That's not the case anymore.

This field is now a `*bool` as to let daemon's config define the default
value. IPv6 can still be enabled / disabled by explicitly specifying the
`--ipv6` flag when doing `docker network create`.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-06-07 03:17:46 +02:00
Albin Kerouanton 0ed8a7e310 vendor: github.com/docker/docker 00f18ef7a455 (master / v27.0.0-dev)
- api: Make EnableIPv6 optional

full diff: c6aaabc9fc...00f18ef7a4

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-06-06 20:59:27 +02:00
Sebastiaan van Stijn bc2e274782
vendor: migrate to github.com/go-viper/mapstructure/v2 v2.0.0
github.com/mitchellh/mapstructure will no longer be maintained by the author,
and github.com/go-viper/mapstructure is nominated as the endorsed fork.

- v1.x changes since last release from mitchellh: https://github.com/go-viper/mapstructure/compare/v1.5.0...v1.6.0
- v2.0 changes: https://github.com/go-viper/mapstructure/compare/v1.6.0...v2.0.0

Breaking changes

Error is removed in favor of errors.Join (backported from Go 1.20 to preserve
compatibility with earlier versions)

What's Changed

- feat!: update module path
- build: update dev env
- feature: add StringToBasicTypeHookFunc and support complex
- Add an example showing how to use a DecodeHookFunc to parse a custom field.
- Remove exposed error type
- Replace internal joined error with errors.Join

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-06 00:05:45 +02:00
Sebastiaan van Stijn 23148220ec
vendor: github.com/docker/docker c6aaabc9fc82 (master / v27.0.0-dev)
- api: move more network-related types to api/types/network

full diff: cd3804655a...c6aaabc9fc

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-05 16:29:55 +02:00
Sebastiaan van Stijn 20d1b661bc
cli/command: use shallower interface for completions
The completion functions only need the API-client, and not all of
the CLI. However, passing the API-client as argument would mean
that the API-client is initialized early, which may not be what
we want, so instead, defining an APIClientProvider interface to
preserve the behavior of initializing when needed only.

While updating, also simplify stack.format to only require an
io.Writer.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-04 12:04:11 +02:00
Sebastiaan van Stijn ce85b24440
Merge pull request #5110 from thaJeztah/bump_engine
vendor: github.com/docker/docker cd3804655a25 (master / v27.0.0-dev)
2024-06-04 10:34:15 +02:00
Sebastiaan van Stijn b6a3ce4167
vendor: github.com/docker/docker cd3804655a25 (master / v27.0.0-dev)
full diff: e622cea556...cd3804655a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-04 09:17:20 +02:00
Casey Korver d4491fc093 Correct typos in the cli/ folder
Signed-off-by: Casey Korver <casey@korver.dev>
2024-06-04 03:08:56 +00:00
Sebastiaan van Stijn e2fc6bd771
vendor: github.com/docker/docker e622cea55698 (master / v27.0.0-dev)
full diff: 06e3a49d66...e622cea556

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 17:39:37 +02:00
Sebastiaan van Stijn fed9fa0f72
context list: temporarily add ContextType to JSON output
Docker Desktop currently ships with the "cloud integration" wrapper,
which outputs an additional ContextType field in the JSON output.

While this field is non-standard, it made its way into Visual Studio's
Docker integration, which uses this to exclude "aci" and "eci" context
types that are not supported by Visual Studio.

This patch;

- conditionally adds a ContextType field to the JSON output
- but ONLY when using the default "{{json .}}" or "json" formats
  (which are the formats used by Visual Studio)
- if the context is a "aci" or "eci" context, that type is
  preserved, otherwise the default "moby" type is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 13:08:31 +02:00
Sebastiaan van Stijn 40a1da8b42
cli/command/context: list: add test for JSON output
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 10:54:15 +02:00
Sebastiaan van Stijn 2e9eff235d
cli/command/context: test inspecting context with custom metadata
The CLI does not currently expose options to add custom metadata to
contexts, but contexts support them.

- update test-utilities to allow setting custom metadata
- update the inspect test to verify that custom metadata is included
  when inspecting a context.
- update the import/export tests to verify that custom metadata
  is preserved.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 10:49:50 +02:00
Sebastiaan van Stijn 54291dd47a
cli/command/context: add test-utility to create multiple contexts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 10:31:16 +02:00
Albin Kerouanton 8ed44f916f
Merge pull request #4994 from robmry/47639_per-interface-sysctls
Document CLI support for per interface sysctls
2024-05-29 11:03:28 +02:00
Sebastiaan van Stijn 7dc271a8be
migrate to new github.com/containerd/platforms package
The github.com/containerd/containerd/platforms package was moved to a separate
module in preparation of the containerd v2.0 release.

Switch to the new module, which means we also remove containerd as a direct
dependency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-27 11:55:23 +02:00
Rob Murray 7f9dba60e2 Test quoted fields in --driver-opt
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-05-26 13:17:22 +01:00
Sebastiaan van Stijn dc75e9ed6c
cli/config: do not discard permission errors when loading config-file
When attempting to load a config-file that exists, but is not accessible for
the current user, we should not discard the error.

This patch makes sure that the error is returned by Load(), but does not yet
change LoadDefaultConfigFile, as this requires a change in signature.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-22 10:31:59 +02:00
Sebastiaan van Stijn c80adf4e87
cli/config: TestLoadDefaultConfigFile: check that no warnings are printed
Loading the config should print no warnings on a successful load.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-22 10:31:59 +02:00
Sebastiaan van Stijn de91207b87
cli/config: add test for dangling symlink for config-file
This may need further discussion, but we currently handle dangling
symlinks gracefully, so let's add a test for this, and verify that
we don't replace symlinks with a file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-22 10:31:58 +02:00
Sebastiaan van Stijn 426fb2fd81
cli/config: Load(), LoadDefaultConfigFile(): improve GoDoc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-22 10:31:47 +02:00
Sebastiaan van Stijn 6d21372dbb
run, create: update "--rm" flag description to mention anonymous volumes
The "--rm" flag deletes both the container and any anonymous volumes
associated with the container when the container exits.

This patch updates the flag description to also mention volumes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-21 13:52:56 +02:00
Paweł Gronowski 1527d625f3
Plumb context to API callbacks
Signatures of these functions were changed in 80d92fd45007b6395dc2db5f93def3b159dacd7f

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-05-17 14:39:49 +02:00
Sebastiaan van Stijn 4445e77025
Merge pull request #5029 from racequite/master
chore: fix function names in comment
2024-05-17 10:11:20 +02:00
Sebastiaan van Stijn ad3bcf8f3d
Merge pull request #5018 from njucjc/remove_dualstack
chore: remove deprecated DualStack field
2024-05-16 15:02:40 +02:00
Laura Brehm 5f4f4f64d3
OTel: implement missing MeterProvider `ForceFlush`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-05-15 00:05:31 +01:00
Laura Brehm f07834d185
OTel: add `command.time` metric to plugin commands
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-05-15 00:05:30 +01:00
Christopher Petito 02537eac59 Use funcs on DockerCli to return Meter/TracerProviders, not initialize them. Initialize them during DockerCli struct init
Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
2024-05-14 15:23:49 +00:00
Rob Murray e8bfedd266 Fix TestNetworkConnectWithFlags
The test didn't do anything useful...
- Despite its name it used newCreateCommand() instead of
  newConnectCommand() with create flags/options instead of connect.
- There was no fake networkCreateFunc(), so the result of the 'connect'
  wasn't checked.
- The fake networkConnectFunc() was never called, so didn't spot the
  problem.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-05-08 14:13:59 +01:00
Laura Brehm 31644d5ea7
Fix hang when container fails to start
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-05-07 11:22:17 +01:00
Paweł Gronowski 840016ea05
waitExitOrRemoved: Handle context cancellation
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-04-29 16:46:11 +02:00
racequite dccfd6e4d0 chore: fix function names in comment
Signed-off-by: racequite <quiterace@gmail.com>
2024-04-19 12:24:42 +08:00
Christopher Petito d6796c002f Fix OTLP env var overriding
Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
2024-04-17 14:32:41 +00:00
njucjc 73959eef71 chore: remove deprecated DualStack field
Signed-off-by: njucjc <njucjc@gmail.com>
2024-04-15 17:53:35 +08:00
Laura Brehm cefcba9871
otel: capture exit code as int64
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-04-04 19:11:56 +01:00
Bjorn Neergaard 10b9810989
Merge pull request #4978 from laurazard/otel-add-tty
otel: capture whether process was invoked from a terminal
2024-04-04 06:09:48 -06:00
Laura Brehm 204b324291
Merge pull request #4975 from jsternberg/otel-error-handler
command: include default otel error handler for the cli
2024-04-04 03:56:41 +01:00
Laura Brehm ee1b2836af
otel: capture whether process was invoked from a terminal
This commit adds a "terminal" attribute to `BaseMetricAttributes`
that allows us to discern whether an invocation was from an interactive
terminal or not.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-04-04 03:28:17 +01:00