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

Function ServerVersion

pkg/infoutil/infoutil.go:130–150  ·  view source on GitHub ↗
(ctx context.Context, client *containerd.Client)

Source from the content-addressed store, hash-verified

128}
129
130func ServerVersion(ctx context.Context, client *containerd.Client) (*dockercompat.ServerVersion, error) {
131 daemonVersion, err := client.Version(ctx)
132 if err != nil {
133 return nil, err
134 }
135
136 v := &dockercompat.ServerVersion{
137 Components: []dockercompat.ComponentVersion{
138 {
139 Name: "containerd",
140 Version: daemonVersion.Version,
141 Details: map[string]string{"GitCommit": daemonVersion.Revision},
142 },
143 runcVersion(),
144 },
145 }
146 if rootlessutil.IsRootless() {
147 v.Components = append(v.Components, rootlessKitVersion(ctx))
148 }
149 return v, nil
150}
151
152func buildctlVersion() dockercompat.ComponentVersion {
153 buildctlBinary, err := buildkitutil.BuildctlBinary()

Callers 1

versionInfoFunction · 0.92

Calls 3

IsRootlessFunction · 0.92
runcVersionFunction · 0.85
rootlessKitVersionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…