Skip to content

Commit 4b58ef0

Browse files
authored
Merge pull request kubernetes#83950 from yastij/update-reset-cni
stop removing cni directories as they aren't installed by kubeadm
2 parents fa99d40 + e591190 commit 4b58ef0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/kubeadm/app/cmd/phases/reset/cleanupnode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func runCleanupNode(c workflow.RunData) error {
8181
klog.Warningf("[reset] Failed to remove containers: %v\n", err)
8282
}
8383

84-
r.AddDirsToClean("/etc/cni/net.d", "/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni")
84+
r.AddDirsToClean("/var/lib/dockershim", "/var/run/kubernetes", "/var/lib/cni")
8585

8686
// Remove contents from the config and pki directories
8787
klog.V(1).Infoln("[reset] Removing contents from the config and pki directories")

cmd/kubeadm/app/cmd/reset.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ var (
4949
The reset process does not clean your kubeconfig files and you must remove them manually.
5050
Please, check the contents of the $HOME/.kube/config file.
5151
`)
52+
53+
cniCleanupInstructions = dedent.Dedent(`
54+
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
55+
`)
5256
)
5357

5458
// 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
179183
data := c.(*resetData)
180184
cleanDirs(data)
181185

186+
// output help text instructing user how to remove cni folders
187+
fmt.Print(cniCleanupInstructions)
182188
// Output help text instructing user how to remove iptables rules
183189
fmt.Print(iptablesCleanupInstructions)
184190
return nil

0 commit comments

Comments
 (0)