Merge pull request #10868 from afbjorklund/cni-mkdir

bridge cni: Make sure to create the directory for cni config
pull/10811/head
Medya Ghazizadeh 2021-03-23 00:05:37 -07:00 committed by GitHub
commit 6496ab59be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package cni
import (
"bytes"
"fmt"
"os/exec"
"text/template"
"github.com/pkg/errors"
@ -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")