build: docker exporter should instead use oci with containerd

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2023-05-19 10:49:36 +01:00
parent 17bdbbd3c3
commit 183a73abae
3 changed files with 34 additions and 8 deletions

View File

@ -63,6 +63,23 @@ func (c *Client) LoadImage(ctx context.Context, name string, status progress.Wri
}, nil
}
func (c *Client) Features(ctx context.Context, name string) map[Feature]bool {
features := make(map[Feature]bool)
if dapi, err := c.API(name); err == nil {
if info, err := dapi.Info(ctx); err == nil {
for _, v := range info.DriverStatus {
switch v[0] {
case "driver-type":
if v[1] == "io.containerd.snapshotter.v1" {
features[OCIImporter] = true
}
}
}
}
}
return features
}
type waitingWriter struct {
*io.PipeWriter
f func()