File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,21 @@ func podmanIsAvailable() bool {
32
32
return false
33
33
}
34
34
return strings .HasPrefix (lines [0 ], "podman version" )
35
+ }
35
36
37
+ func nerdctlIsAvailable () bool {
38
+ cmd := kindexec .Command ("nerdctl" , "-v" )
39
+ lines , err := kindexec .OutputLines (cmd )
40
+ if err != nil || len (lines ) != 1 {
41
+ // check finch
42
+ cmd = kindexec .Command ("finch" , "-v" )
43
+ lines , err = kindexec .OutputLines (cmd )
44
+ if err != nil || len (lines ) != 1 {
45
+ return false
46
+ }
47
+ return strings .HasPrefix (lines [0 ], "finch version" )
48
+ }
49
+ return strings .HasPrefix (lines [0 ], "nerdctl version" )
36
50
}
37
51
38
52
func init () {
@@ -41,6 +55,15 @@ func init() {
41
55
}
42
56
if podmanIsAvailable () {
43
57
containerRuntime = "podman"
58
+ return
59
+ }
60
+ if nerdctlIsAvailable () {
61
+ containerRuntime = "nerdctl"
62
+ if _ , err := exec .LookPath ("nerdctl" ); err != nil {
63
+ if _ , err := exec .LookPath ("finch" ); err == nil {
64
+ containerRuntime = "finch"
65
+ }
66
+ }
44
67
}
45
68
}
46
69
You can’t perform that action at this time.
0 commit comments