MCPcopy Create free account
hub / github.com/containerd/nerdctl / versionInfo

Function versionInfo

cmd/nerdctl/version.go:121–135  ·  view source on GitHub ↗

versionInfo may return partial VersionInfo on error. Address can be empty to skip inspecting the server.

(cmd *cobra.Command, ns, address string)

Source from the content-addressed store, hash-verified

119// versionInfo may return partial VersionInfo on error.
120// Address can be empty to skip inspecting the server.
121func versionInfo(cmd *cobra.Command, ns, address string) (dockercompat.VersionInfo, error) {
122 v := dockercompat.VersionInfo{
123 Client: infoutil.ClientVersion(),
124 }
125 if address == "" {
126 return v, nil
127 }
128 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), ns, address)
129 if err != nil {
130 return v, err
131 }
132 defer cancel()
133 v.Server, err = infoutil.ServerVersion(ctx, client)
134 return v, err
135}

Callers 1

versionActionFunction · 0.85

Calls 3

ClientVersionFunction · 0.92
NewClientFunction · 0.92
ServerVersionFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…