mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-09-26 19:31:17 +08:00
refactor: remove temp kubeconfig before daemon quit
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
|
||||
)
|
||||
|
||||
func DownloadFileWithName(uri, name string) (string, error) {
|
||||
@@ -120,7 +122,7 @@ func ParseDirMapping(dir string) (local, remote string, err error) {
|
||||
}
|
||||
|
||||
func CleanupTempKubeConfigFile() error {
|
||||
return filepath.Walk(os.TempDir(), func(path string, info fs.FileInfo, err error) error {
|
||||
return filepath.Walk(config.GetTempPath(), func(path string, info fs.FileInfo, err error) error {
|
||||
if strings.HasSuffix(path, ".kubeconfig") {
|
||||
return os.Remove(path)
|
||||
}
|
||||
|
Reference in New Issue
Block a user