From c052d1ad18f0bea61256f3a0af16d772f2e094be Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 20 Aug 2020 17:54:42 -0700 Subject: [PATCH] Allow flannel CNI to work with kicbase by relocating conflicting file --- pkg/minikube/cni/flannel.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/minikube/cni/flannel.go b/pkg/minikube/cni/flannel.go index fea691e6facd..c5b29ce7d83a 100644 --- a/pkg/minikube/cni/flannel.go +++ b/pkg/minikube/cni/flannel.go @@ -18,9 +18,12 @@ package cni import ( "os/exec" + "path/filepath" + "github.com/golang/glog" "github.com/pkg/errors" "k8s.io/minikube/pkg/minikube/config" + "k8s.io/minikube/pkg/minikube/driver" ) // 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") } + 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))) }