Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions cmd/kubeadm/app/cmd/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down