diff --git a/pkg/common/func.go b/pkg/common/func.go index 3ba8d84..c613fe5 100644 --- a/pkg/common/func.go +++ b/pkg/common/func.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "strconv" + "strings" "k8s.io/client-go/kubernetes" @@ -58,6 +59,14 @@ func NewInterLinkConfig() (InterLinkConfig, error) { } yaml.Unmarshal(yfile, &InterLinkConfigInst) + if !strings.HasSuffix(InterLinkConfigInst.DataRootFolder, "/") { + InterLinkConfigInst.DataRootFolder += "/" + } + + if strings.HasPrefix(InterLinkConfigInst.DataRootFolder, "~") { + InterLinkConfigInst.DataRootFolder = strings.Replace(InterLinkConfigInst.DataRootFolder, "~", "$HOME", 1) + } + if os.Getenv("INTERLINKURL") != "" { InterLinkConfigInst.Interlinkurl = os.Getenv("INTERLINKURL") }