mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 05:46:37 +00:00
change udmrepo config file location to tmp
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
1
changelogs/unreleased/8602-Lyndon-Li
Normal file
1
changelogs/unreleased/8602-Lyndon-Li
Normal file
@@ -0,0 +1 @@
|
||||
Fix issue #8067, add tmp folder (/tmp for linux, C:\Windows\Temp for Windows) as an alternative of udmrepo's config file location
|
||||
@@ -200,7 +200,12 @@ func GetRepoDomain() string {
|
||||
|
||||
func getRepoConfigFile(workPath string, repoID string) string {
|
||||
if workPath == "" {
|
||||
workPath = filepath.Join(os.Getenv("HOME"), "udmrepo")
|
||||
home := os.Getenv("HOME")
|
||||
if home != "" {
|
||||
workPath = filepath.Join(home, "udmrepo")
|
||||
} else {
|
||||
workPath = filepath.Join(os.TempDir(), "udmrepo")
|
||||
}
|
||||
}
|
||||
|
||||
name := "repo-" + strings.ToLower(repoID) + ".conf"
|
||||
|
||||
Reference in New Issue
Block a user