Skip to content

Commit

Permalink
Make sure to create the directory for cni config
Browse files Browse the repository at this point in the history
Otherwise it will be created with the mktemp permissions
and become unreadable (0700), making chmod fail later on.
  • Loading branch information
afbjorklund committed Mar 19, 2021
1 parent d42ff1a commit c462f6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/minikube/cni/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cni
import (
"bytes"
"fmt"
"os/exec"
"text/template"

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

if _, err := r.RunCmd(exec.Command("sudo", "mkdir", "-p", "/etc/cni/net.d")); err != nil {
return err
}

f, err := c.netconf()
if err != nil {
return errors.Wrap(err, "netconf")
Expand Down

0 comments on commit c462f6c

Please sign in to comment.