(ctx context.Context, client *containerd.Client)
| 128 | } |
| 129 | |
| 130 | func 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 | |
| 152 | func buildctlVersion() dockercompat.ComponentVersion { |
| 153 | buildctlBinary, err := buildkitutil.BuildctlBinary() |
no test coverage detected
searching dependent graphs…