MCPcopy Index your code
hub / github.com/docker/cli / newClientVersion

Function newClientVersion

cli/command/system/version.go:111–129  ·  view source on GitHub ↗

newClientVersion constructs a new clientVersion. If a dockerCLI is passed as argument, additional information is included (API version), which may invoke an API connection. Pass nil to omit the additional information.

(contextName string, dockerCli command.Cli)

Source from the content-addressed store, hash-verified

109// which may invoke an API connection. Pass nil to omit the additional
110// information.
111func newClientVersion(contextName string, dockerCli command.Cli) clientVersion {
112 v := clientVersion{
113 Version: version.Version,
114 DefaultAPIVersion: client.MaxAPIVersion,
115 GoVersion: runtime.Version(),
116 GitCommit: version.GitCommit,
117 BuildTime: reformatDate(version.BuildTime),
118 Os: runtime.GOOS,
119 Arch: arch(),
120 Context: contextName,
121 }
122 if version.PlatformName != "" {
123 v.Platform = &platformInfo{Name: version.PlatformName}
124 }
125 if dockerCli != nil {
126 v.APIVersion = dockerCli.CurrentVersion()
127 }
128 return v
129}
130
131func newServerVersion(sv client.ServerVersionResult) *serverVersion {
132 out := &serverVersion{

Callers 2

runInfoFunction · 0.85
runVersionFunction · 0.85

Calls 3

reformatDateFunction · 0.85
archFunction · 0.85
CurrentVersionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…