Skip to content

Commit c0482fd

Browse files
committed
cli/command/system/newClientVersion: initialize with default API version
Set the APIVersion and DefaultAPIVersion fields to the default version, as that's the version the client assumes without making a API connection to do version negotiation. One change worth mentioning is that this means that the API version will differ, depending on the format: If no server information is fetched: docker info --format='{{ json .ClientInfo }}' | jq .ApiVersion "1.44" If server information is fetched: docker info --format='{{ json .}}' | jq .ClientInfo.ApiVersion "1.43" An alternative could be to leave the ApiVersion field empty if no negotiation took place. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 0563fa6 commit c0482fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cli/command/system/version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ type clientVersion struct {
9191
func newClientVersion(contextName string, dockerCli command.Cli) clientVersion {
9292
v := clientVersion{
9393
Version: version.Version,
94+
APIVersion: api.DefaultVersion,
9495
DefaultAPIVersion: api.DefaultVersion,
9596
GoVersion: runtime.Version(),
9697
GitCommit: version.GitCommit,

0 commit comments

Comments
 (0)