You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove from the kubeconfig file the kube context (user, cert & key, etc) when we delete a cluster.
When we delete an idpbuilder cluster, the kind cluster is well removed but not the kube context from the kubeconfig file. This is due to the fact that we are missing to pass the path of the file to the command kind lib function provider.Delete(name, "")
// see https://github.com/cnoe-io/idpbuilder/blob/8c6cd9704ae118981a89b3c5b541db1924f31643/pkg/cmd/delete/root.go#L43
provider := cluster.NewProvider(cluster.ProviderWithLogger(kind.KindLoggerFromLogr(&logger)), detectOpt)
if err := provider.Delete(name, ""); err != nil {
return fmt.Errorf("failed to delete cluster %s: %w", name, err)
}
I did a new test and the context is well removed from the kube config file even if we don't pass the path to access it as kind uses the default path in this case. podman ps has also been well removed !
So the only thing todo is to improve the code to let the users to provide their kubeconfig path
Suggestion
Remove from the kubeconfig file the kube context (user, cert & key, etc) when we delete a cluster.
When we delete an idpbuilder cluster, the
kind
cluster is well removed but not thekube context
from the kubeconfig file. This is due to the fact that we are missing to pass the path of the file to the command kind lib functionprovider.Delete(name, "")
See also - kind delete function: https://github.com/kubernetes-sigs/kind/blob/main/pkg/cluster/internal/delete/delete.go#L27-L39
The text was updated successfully, but these errors were encountered: