Skip to content

Commit 084b27a

Browse files
chore: remove /usr/local/bin/k0s on reset (#540)
we need to remove the k0s binary when resetting the server.
1 parent 59e8903 commit 084b27a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/embedded-cluster/uninstall.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,12 @@ var resetCommand = &cli.Command{
434434
}
435435
}
436436

437+
if _, err := os.Stat("/usr/local/bin/k0s"); err == nil {
438+
if err := os.RemoveAll("/usr/local/bin/k0s"); err != nil {
439+
return fmt.Errorf("failed to remove k0s binary: %w", err)
440+
}
441+
}
442+
437443
if c.Bool("reboot") {
438444
if _, err := exec.Command("reboot").Output(); err != nil {
439445
return err

0 commit comments

Comments
 (0)