DockerCLI/cmd/docker
Jonathan A. Sternberg 85dcacd78f
plugins: set OTEL_RESOURCE_ATTRIBUTES when invoking a plugin
When a plugin is invoked, the docker cli will now set
`OTEL_RESOURCE_ATTRIBUTES` to pass OTEL resource attribute names to the
plugin as additional resource attributes. At the moment, the only
resource attribute passed is `cobra.command_path`.

All resource attributes passed by the CLI are prepended with the
namespace `docker.cli` to avoid clashing with existing ones the plugin
uses or ones defined by the user.

For aliased commands like the various builder commands, the command path
is overwritten to match with the original name (such as `docker
builder`) instead of the forwarded name (such as `docker buildx build`).

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-02-28 12:43:05 -08:00
..
internal/signals cli-plugins: terminate plugin when CLI exits 2023-12-12 13:54:30 +00:00
winresources Use goversioninfo to create Windows Version Info 2021-10-11 16:54:22 +02:00
aliases.go build: set default context builder if not specified 2022-11-04 08:42:34 +01:00
builder.go plugins: set OTEL_RESOURCE_ATTRIBUTES when invoking a plugin 2024-02-28 12:43:05 -08:00
builder_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
builder_windows_test.go build: set default context builder if not specified 2022-11-04 08:42:34 +01:00
completions.go cmd/docker: registerCompletionFuncForGlobalFlags: take store.Store as argument 2024-01-11 22:31:17 +01:00
docker.go plugins: fix plugin socket being closed before use 2024-01-15 15:48:57 +00:00
docker_test.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
docker_windows_386.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_amd64.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_arm.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_arm64.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00