Merge pull request #1813 from jedevc/oci-export-on-containerd

This commit is contained in:
Justin Chadwell
2023-06-07 15:19:54 +02:00
committed by GitHub
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()

View File

@ -0,0 +1,5 @@
package dockerutil
type Feature string
const OCIImporter Feature = "OCI importer"