26 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
7e609d491b
vendor: github.com/docker/docker c04dec11437f (master, v28.x dev)
full diff: fd1a78e0a3...c04dec1143

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 17:01:28 +02:00
Sebastiaan van Stijn
e6bf6dcd90
cli/command/formatter: minor cleanups
no need to initialize with an empty string

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 14:10:34 +02:00
Sebastiaan van Stijn
218c7ad958
cli/command/formatter: use ContainerState consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:14 +02:00
Sebastiaan van Stijn
25e6b2da04
cli/command/formatter: fix "unused-receiver" linting
cli/command/formatter/custom.go:35:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c SubHeaderContext) Label(name string) string {
          ^
    cli/command/formatter/container_test.go:334: line-length-limit: line is 204 characters, out of limit 200 (revive)
                context:  Context{Format: NewContainerFormat(`table {{truncate .ID 5}}\t{{json .Image}} {{.RunningFor}}/{{title .Status}}/{{pad .Ports 2 2}}.{{upper .Names}} {{lower .Status}}`, false, true)},
    cli/command/formatter/container_test.go:831: line-length-limit: line is 247 characters, out of limit 200 (revive)
                expected: "80/tcp, 80/udp, 1024/tcp, 1024/udp, 12345/sctp, 1.1.1.1:1024->80/tcp, 1.1.1.1:1024->80/udp, 2.1.1.1:1024->80/tcp, 2.1.1.1:1024->80/udp, 1.1.1.1:80->1024/tcp, 1.1.1.1:80->1024/udp, 2.1.1.1:80->1024/tcp, 2.1.1.1:80->1024/udp",
    cli/command/formatter/disk_usage.go:273:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c *diskUsageImagesContext) Type() string {
          ^
    cli/command/formatter/formatter_test.go:31:7: unused-receiver: method receiver 'f' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (f fakeSubContext) FullHeader() any {
          ^
    cli/command/formatter/reflect_test.go:13:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) Func1() string {
          ^
    cli/command/formatter/disk_usage.go:324:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c *diskUsageContainersContext) Type() string {
          ^
    cli/command/formatter/disk_usage.go:332:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c *diskUsageContainersContext) isActive(ctr container.Summary) bool {
          ^
    cli/command/formatter/reflect_test.go:17:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) func2() string { //nolint:unused
          ^
    cli/command/formatter/reflect_test.go:21:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) Func3() (string, int) {
          ^
    cli/command/formatter/disk_usage.go:385:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c *diskUsageVolumesContext) Type() string {
          ^
    cli/command/formatter/disk_usage.go:446:7: unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (c *diskUsageBuilderContext) Type() string {
          ^
    cli/command/formatter/reflect_test.go:25:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) Func4() int {
          ^
    cli/command/formatter/reflect_test.go:31:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) Func5() dummyType {
          ^
    cli/command/formatter/reflect_test.go:35:7: unused-receiver: method receiver 'd' is not referenced in method's body, consider removing or renaming it as _ (revive)
    func (d *dummy) FullHeader() string {
          ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-17 15:24:56 +01:00
Sebastiaan van Stijn
a0ca41e6f6
cli/command/formatter: suppress some errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-03 12:18:10 +01:00
Sebastiaan van Stijn
b194274beb
replace uses of deprecated API types
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-04 15:22:18 +02:00
Sebastiaan van Stijn
42ba29395b
rename vars to prevent colliding with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-03 17:09:41 +02:00
Sebastiaan van Stijn
46d0ba20f1
vendor: github.com/docker/docker cdb3f9fb8dca (v25.0.0-dev)
full diff: d3afa80b96...cdb3f9fb8d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-13 22:09:04 +02:00
Sebastiaan van Stijn
fb2ba5d63b
migrate reference github.com/distribution/reference
The "reference" package was moved to a separate module, which was extracted
from b9b19409cf

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-05 17:53:20 +02:00
Sebastiaan van Stijn
f02301ab5d
remove uses of deprecated VirtualSize field
The VirtualSize field is deprecated and the upcoming API version v1.44
will no longer propagate the field. See:
1261fe69a3,

Given that in docker 1.10 and up (API v1.22), the VirtualSize and Size
fields contain the same value, and the "df" endpoint was not supported
until API v1.25, we can "safely" use Size instead; see:

- 4ae7176ffb
- 4352da7803

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-28 14:58:53 +02:00
Sebastiaan van Stijn
1da95ff6aa
format code with gofumpt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-30 11:59:11 +02:00
Sebastiaan van Stijn
7aa0b273e5
vendor: github.com/docker/docker 2ed904cad7055847796433cc56ef1d1de0da868c
- replace deprecated types
- also fixing some minor nits

full diff: 8941dcfcc5...2ed904cad7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-30 12:01:37 +02:00
Sebastiaan van Stijn
69f216f6e4
Fix docker ps --format with templating functions
Before this patch, using a template that used templating functions (such as
`lower` or `json`) caused the command to fail in the pre-processor step (in
`buildContainerListOptions`):

    docker ps --format='{{upper .Names}}'
    template: :1:8: executing "" at <.Names>: invalid value; expected string

This problem was due to the pre-processing using a different "context" type than
was used in the actual template, and custom functions to not be defined when
instantiating the Go template.

With this patch, using functions in templates works correctly:

    docker ps --format='{{upper .Names}}'
    MUSING_NEUMANN
    ELOQUENT_MEITNER

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-27 12:35:55 +01:00
Vincent Demeester
69fdd2a4ad
formatter package heavy refactoring
- make it possible to extract the formatter implementation from the
  "common" code, that way, the formatter package stays small
- extract some formatter into their own packages

This is essentially moving the "formatter" implementation of each type
in their respective packages. The *main* reason to do that, is to be
able to depend on `cli/command/formatter` without depending of the
implementation detail of the formatter. As of now, depending on
`cli/command/formatter` means we depend on `docker/docker/api/types`,
`docker/licensing`, … — that should not be the case. `formatter`
should hold the common code (or helpers) to easily create formatter,
not all formatter implementations.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-10-23 17:05:44 +02:00
Tibor Vass
a90b99edfc system/df: allow -v with --format
This allows to provide more information for build cache disk usage.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-13 23:14:58 +00:00
Tibor Vass
ca608c2302 system df: show table output for build cache
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-05 03:31:40 +00:00
Tibor Vass
c806eb49c9 build: add options to builder prune
This patch adds --filter, --keep-storage, --all and --force to builder prune.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-05 00:01:16 +00:00
Tibor Vass
b3a5c153d5 build: address some review nits
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 22:40:31 +00:00
Tonis Tiigi
b19294ee42 system: add buildcache formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-09 20:51:34 +00:00
Daniel Nephin
dbd96badb6 Add nakedret linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-12 11:48:51 -04:00
Daniel Nephin
102a8f0c9d Pin all tools used in the Dockerfiles
Also update gometalinter to use the official version. The update
found some new gosimple errors, which are fixed.

Also update the filewatcher script for the latest version of filewatcher.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-11 14:23:27 -04:00
Tonis Tiigi
b95638a5ac Use long running session in builder
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>

Add incremental context send support

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-06-26 16:30:01 -07:00
Daniel Nephin
c60d13e539 Fix cyclomatic complexity of two formatters
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-23 11:34:22 -07:00
Daniel Nephin
3724fb7f37 Add gosimple lint
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:55:08 -07:00
Daniel Nephin
01e1e58ada Add unused linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:54:27 -07:00
Daniel Nephin
1630fc40f8 Import docker/docker/cli
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-04-17 17:40:59 -04:00