Merge pull request #9046 from tstromberg/cni-true
Allow flannel CNI to work with kicbase by fixing IP conflictpull/9052/head
commit
f492215009
|
@ -18,9 +18,12 @@ package cni
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/golang/glog"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"k8s.io/minikube/pkg/minikube/config"
|
"k8s.io/minikube/pkg/minikube/config"
|
||||||
|
"k8s.io/minikube/pkg/minikube/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// From https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
// From https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
||||||
|
@ -646,6 +649,14 @@ func (c Flannel) Apply(r Runner) error {
|
||||||
return errors.Wrap(err, "required 'portmap' CNI plug-in not found")
|
return errors.Wrap(err, "required 'portmap' CNI plug-in not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if driver.IsKIC(c.cc.Driver) {
|
||||||
|
conflict := "/etc/cni/net.d/100-crio-bridge.conf"
|
||||||
|
_, err := r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict))))
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("unable to disable %s: %v", conflict, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return applyManifest(c.cc, r, manifestAsset([]byte(flannelTmpl)))
|
return applyManifest(c.cc, r, manifestAsset([]byte(flannelTmpl)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue