Omit error message if 100-crio-bridge.conf has already been disabled

pull/9505/head
Thomas Stromberg 2020-10-20 17:27:45 -07:00
parent e18b312f77
commit 94e91d7f03
1 changed files with 8 additions and 1 deletions

View File

@ -651,7 +651,14 @@ func (c Flannel) Apply(r Runner) error {
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))))
_, err := r.RunCmd(exec.Command("stat", conflict))
if err != nil {
klog.Warningf("%s not found, skipping disable step: %v", conflict, err)
return nil
}
_, err = r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict))))
if err != nil {
klog.Errorf("unable to disable %s: %v", conflict, err)
}