mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
refactor: change temp kubeconfig to ~/.kubevpn/tmp
This commit is contained in:
@@ -21,6 +21,8 @@ const (
|
||||
LogFile = "daemon.log"
|
||||
|
||||
ConfigFile = "config.yaml"
|
||||
|
||||
TmpDir = "tmp"
|
||||
)
|
||||
|
||||
//go:embed config.yaml
|
||||
@@ -51,6 +53,14 @@ func init() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = os.MkdirAll(GetTempPath(), 0755)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = os.Chmod(GetTempPath(), 0755)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
path := filepath.Join(HomePath, ConfigFile)
|
||||
_, err = os.Stat(path)
|
||||
@@ -85,3 +95,7 @@ func GetSyncthingPath() string {
|
||||
func GetConfigFilePath() string {
|
||||
return filepath.Join(HomePath, ConfigFile)
|
||||
}
|
||||
|
||||
func GetTempPath() string {
|
||||
return filepath.Join(HomePath, TmpDir)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user