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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jokestax
Copy link
Contributor

@jokestax jokestax commented Nov 4, 2024

Description

when we do "kubefirst k3d destroy",it doesnt delete the k1dir repo which return an error that "repo already exists" when we try to provision a k3d cluster again

@jokestax jokestax self-assigned this Nov 4, 2024
@jokestax jokestax linked an issue Nov 4, 2024 that may be closed by this pull request
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i understand the desire to remove the k1dir. i want to also question that this is a change instead of an addition. why don't we want to remove the kubeconfig any longer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ultimate goal to make a k3d provisioning possible again is to to remove the directory,i am not sure what was the thought behind removing kubeconfig,but this change should work smoothly for k3d reprovisioning

@jokestax jokestax linked an issue Nov 4, 2024 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubefirst reset command does not work kubefirst reset needs to be more aggressive with its cleanup
2 participants