Skip to content

Commit c462f6c

Browse files
committed
Make sure to create the directory for cni config
Otherwise it will be created with the mktemp permissions and become unreadable (0700), making chmod fail later on.
1 parent d42ff1a commit c462f6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: pkg/minikube/cni/bridge.go

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cni
1919
import (
2020
"bytes"
2121
"fmt"
22+
"os/exec"
2223
"text/template"
2324

2425
"github.com/pkg/errors"
@@ -84,6 +85,10 @@ func (c Bridge) Apply(r Runner) error {
8485
return fmt.Errorf("bridge CNI is incompatible with multi-node clusters")
8586
}
8687

88+
if _, err := r.RunCmd(exec.Command("sudo", "mkdir", "-p", "/etc/cni/net.d")); err != nil {
89+
return err
90+
}
91+
8792
f, err := c.netconf()
8893
if err != nil {
8994
return errors.Wrap(err, "netconf")

0 commit comments

Comments
 (0)