DockerCLI/cli/command/context
Sebastiaan van Stijn 258e27438f
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>
(cherry picked from commit fed9fa0f72)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-05-31 14:48:35 +02:00
..
testdata context list: temporarily add ContextType to JSON output 2024-05-31 14:48:35 +02:00
cmd.go introduce `context show` command 2022-04-25 14:40:24 +02:00
create.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
create_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
export-import_test.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
export.go cli/command/context: remove deprecated k8s / orchestrator option-stubs 2023-06-21 11:39:04 +02:00
import.go Introduce .zip import for docker context 2019-05-29 12:58:45 -07:00
inspect.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
inspect_test.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
list.go context list: temporarily add ContextType to JSON output 2024-05-31 14:48:35 +02:00
list_test.go cli/command/context: list: add test for JSON output 2024-05-31 14:48:19 +02:00
options.go cli/command/context: don't pass CLI if we only need context-store 2023-06-20 13:39:02 +02:00
remove.go cli/context/store: simplify error handling, and make it more idiomatic 2022-09-30 11:19:25 +02:00
remove_test.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
show.go cli/command/context: "docker context show": don't validate context 2022-11-28 11:30:35 +01:00
show_test.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
update.go golangci-lint: revive: enable import-shadowing 2023-11-20 19:52:41 +01:00
update_test.go cli/command/context: test inspecting context with custom metadata 2024-05-31 14:48:19 +02:00
use.go context use: don't create/update config file and directories if not needed 2022-07-29 14:20:05 +02:00
use_test.go cli/command/context: don't use pkg/homedir in test 2023-06-26 13:35:42 +02:00