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

fix: delete k1dir instead of kubeconfig file #2317

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/k3d/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ func destroyK3d(_ *cobra.Command, _ []string) error {
viper.WriteConfig()
}

if _, err := os.Stat(config.K1Dir + "/kubeconfig"); !os.IsNotExist(err) {
if err := os.Remove(config.K1Dir + "/kubeconfig"); err != nil {
return fmt.Errorf("unable to delete %q: %w", config.K1Dir+"/kubeconfig", err)
if _, err := os.Stat(config.K1Dir); !os.IsNotExist(err) {
jokestax marked this conversation as resolved.
Show resolved Hide resolved
if err := os.RemoveAll(config.K1Dir); err != nil {
return fmt.Errorf("unable to delete %q: %w", config.K1Dir, err)
}
}
time.Sleep(200 * time.Millisecond)
Expand Down
Loading