DockerCLI/cli/command/formatter
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
..
tabwriter golangci-lint: enable more linters 2023-11-20 19:52:46 +01:00
testdata formatter: reduce minimum width for columns in table-view 2020-08-31 16:31:15 +02:00
buildcache.go golangci-lint: enable perfsprint linter 2023-11-20 16:18:19 +01:00
container.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
container_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
context.go context list: temporarily add ContextType to JSON output 2024-05-31 14:48:35 +02:00
custom.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
disk_usage.go vendor: github.com/docker/docker cdb3f9fb8dca (v25.0.0-dev) 2023-10-13 22:09:04 +02:00
disk_usage_test.go format code with gofumpt 2022-09-30 11:59:11 +02:00
displayutils.go linting: Consider pre-allocating sliceVar (prealloc) 2023-11-20 16:02:16 +01:00
displayutils_test.go format code with gofumpt 2022-09-30 11:59:11 +02:00
formatter.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
formatter_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
image.go golangci-lint: revive: enable empty-lines 2023-11-20 19:52:45 +01:00
image_test.go golangci-lint: enable more linters 2023-11-20 19:52:46 +01:00
reflect.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
reflect_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00
volume.go linting: Consider pre-allocating sliceVar (prealloc) 2023-11-20 16:02:16 +01:00
volume_test.go add //go:build directives to prevent downgrading to go1.16 language 2023-12-14 15:03:46 +01:00