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

Function runVersion

cli/command/system/version.go:212–230  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, opts *versionOptions)

Source from the content-addressed store, hash-verified

210}
211
212func runVersion(ctx context.Context, dockerCLI command.Cli, opts *versionOptions) error {
213 var err error
214 tmpl, err := newVersionTemplate(opts.format)
215 if err != nil {
216 return cli.StatusError{StatusCode: 64, Status: err.Error()}
217 }
218
219 vd := versionInfo{
220 Client: newClientVersion(dockerCLI.CurrentContext(), dockerCLI),
221 }
222 sv, err := dockerCLI.Client().ServerVersion(ctx, client.ServerVersionOptions{})
223 if err == nil {
224 vd.Server = newServerVersion(sv)
225 }
226 if err2 := prettyPrintVersion(dockerCLI.Out(), vd, tmpl); err2 != nil && err == nil {
227 err = err2
228 }
229 return err
230}
231
232func prettyPrintVersion(out io.Writer, vd versionInfo, tmpl *template.Template) error {
233 t := tabwriter.NewWriter(out, 20, 1, 1, ' ', 0)

Callers 1

newVersionCommandFunction · 0.85

Calls 9

newVersionTemplateFunction · 0.85
newClientVersionFunction · 0.85
newServerVersionFunction · 0.85
prettyPrintVersionFunction · 0.85
CurrentContextMethod · 0.65
ClientMethod · 0.65
OutMethod · 0.65
ErrorMethod · 0.45
ServerVersionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…