stop removing cni directories as they aren't installed by kubeadm

Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
This commit is contained in:
Yassine TIJANI 2019-10-15 15:44:28 +02:00
parent 184769bd5e
commit e591190cf2
2 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,7 @@ func runCleanupNode(c workflow.RunData) error {
klog.Warningf("[reset] Failed to remove containers: %v\n", err)
}
r.AddDirsToClean("/etc/cni/net.d", "/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni")
r.AddDirsToClean("/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni")
// Remove contents from the config and pki directories
klog.V(1).Infoln("[reset] Removing contents from the config and pki directories")

View File

@ -49,6 +49,10 @@ var (
The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.
`)
cniCleanupInstructions = dedent.Dedent(`
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
`)
)
// resetOptions defines all the options exposed via flags by kubeadm reset.
@ -179,6 +183,8 @@ func NewCmdReset(in io.Reader, out io.Writer, resetOptions *resetOptions) *cobra
data := c.(*resetData)
cleanDirs(data)
// output help text instructing user how to remove cni folders
fmt.Print(cniCleanupInstructions)
// Output help text instructing user how to remove iptables rules
fmt.Print(iptablesCleanupInstructions)
return nil