Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Apr 10, 2023

cli/command/system: move ServerOK() together with type definition

cli/command/system: add platformInfo type, and fix "omitempty"

The Platform field was defined with omitempty, but would always be shown
in the JSON output, because it was never nil.

cli/command/system: clientVersion: make all fields "omitempty"

This allows the type to be used for situations where this information is not present,
or not to be printed.

cli/command/system: add newClientVersion() utility

docker info: include Client Version and "platform name"

This patch adds additional information to the Client section of the output.
We were already outputting versions of CLI Plugins, and the Server, but not
for the Client.

Adding this information can help with bug-reports where the reporter only
provided the docker info output, or (e.g.) only docker --version. The
platform name helps identify what kind of builds the user has installed
(e.g. docker's docker-ce packages have "Docker Engine - Community" set
for this), although we should consider including "packager" information
as a more formalized field for this information.

Before this patch:

$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
...

With this patch applied:

$ docker info
Client: Docker Engine - Community
 Version:    24.0.0-dev
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
...

- Description for the changelog

The "Client" section in `docker info` now includes the version and platform information (e.g. "Docker Engine - Community") of the `docker` CLI. 

- A picture of a cute animal (not mandatory but encouraged)

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2023

Codecov Report

Merging #4180 (8ee7711) into master (6233560) will increase coverage by 0.00%.
The diff coverage is 77.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4180   +/-   ##
=======================================
  Coverage   59.04%   59.05%           
=======================================
  Files         288      288           
  Lines       24775    24793   +18     
=======================================
+ Hits        14629    14641   +12     
- Misses       9262     9267    +5     
- Partials      884      885    +1     

It's defined on a non-exported type, and was only used in a template.
Replacing for a basic "nil" check, which should do the same.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The Platform field was defined with omitempty, but would always be shown
in the JSON output, because it was never nil.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This allows the type to be used for situations where this information is
not present, or not to be printed.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This patch adds additional information to the Client section of the output.
We were already outputting versions of CLI Plugins, and the Server, but not
for the Client.

Adding this information can help with bug-reports where the reporter only
provided the `docker info` output, or (e.g.) only `docker --version`. The
platform name helps identify what kind of builds the user has installed
(e.g. docker's docker-ce packages have "Docker Engine - Community" set
for this), although we should consider including "packager" information
as a more formalized field for this information.

Before this patch:

    $ docker info
    Client:
     Context:    default
     Debug Mode: false
     Plugins:
      buildx: Docker Buildx (Docker Inc.)
        Version:  v0.10.4
        Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    ...

With this patch applied:

    $ docker info
    Client: Docker Engine - Community
     Version:    24.0.0-dev
     Context:    default
     Debug Mode: false
     Plugins:
      buildx: Docker Buildx (Docker Inc.)
        Version:  v0.10.4
        Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    ...

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the docker_info_version branch from cf443e9 to 8ee7711 Compare April 11, 2023 16:58
@thaJeztah thaJeztah merged commit c697659 into docker:master Apr 12, 2023
@thaJeztah thaJeztah deleted the docker_info_version branch April 12, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants