Skip to content

Commit

Permalink
Merge pull request #231 from rumpl/containerd-storage-check
Browse files Browse the repository at this point in the history
Use DriverStatus to check if containerd is used
  • Loading branch information
natalieparellano authored Oct 30, 2023
2 parents 36b290a + 8edc145 commit 59d2bf9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions local/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"io"
"os"
"path/filepath"
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
Expand Down Expand Up @@ -71,7 +70,14 @@ func usesContainerdStorage(docker DockerClient) bool {
if err != nil {
return false
}
return strings.Contains(info.Driver, "stargz")

for _, driverStatus := range info.DriverStatus {
if driverStatus[0] == "driver-type" && driverStatus[1] == "io.containerd.snapshotter.v1" {
return true
}
}

return false
}

func (i *Image) doSaveAs(name string) (types.ImageInspect, error) {
Expand Down

0 comments on commit 59d2bf9

Please sign in to comment.