From 1eb65e78c36228593dd2e2bf21cbcf4bcba63d8c Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 9 May 2024 17:20:38 +0800 Subject: [PATCH] fix: close temporary kubeconfig file (#1441) --- pkg/plugin/kubeconfig.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/plugin/kubeconfig.go b/pkg/plugin/kubeconfig.go index afacf0125..585e4be6e 100644 --- a/pkg/plugin/kubeconfig.go +++ b/pkg/plugin/kubeconfig.go @@ -123,6 +123,7 @@ func PersistKubeConfig(_ context.Context, kc []byte) (string, func(context.Conte if err != nil { return "", nil, errors.Wrap(err, "while writing kube config to file") } + defer file.Close() abs, err := filepath.Abs(file.Name()) if err != nil {