From 521bae36dd3023bd3b30840dd2372a000e94bc01 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Wed, 15 Apr 2020 12:42:53 +0300 Subject: [PATCH] Fix http file server address for local run - use storage port in the artifacts URL - create bin dir for local run --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 898227c6..51fd6e85 100644 --- a/main.go +++ b/main.go @@ -84,7 +84,7 @@ func main() { os.Exit(1) } - storage := mustInitStorage(storagePath, setupLog) + storage := mustInitStorage(storagePath, storageAddr, setupLog) go startFileServer(storage.BasePath, storageAddr, setupLog) @@ -135,13 +135,14 @@ func startFileServer(path string, address string, l logr.Logger) { } } -func mustInitStorage(path string, l logr.Logger) *controllers.Storage { +func mustInitStorage(path string, storageAddr string, l logr.Logger) *controllers.Storage { if path == "" { p, _ := os.Getwd() path = filepath.Join(p, "bin") + os.MkdirAll(path, 0777) } - hostname := "localhost" + hostname := "localhost" + storageAddr if os.Getenv("RUNTIME_NAMESPACE") != "" { svcParts := strings.Split(os.Getenv("HOSTNAME"), "-") hostname = fmt.Sprintf("%s.%s",