Skip to content

Commit 47c7197

Browse files
authored
Merge pull request #24 from fluxcd/local-run
Fix http file server address on localhost
2 parents 1e3bc47 + 521bae3 commit 47c7197

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func main() {
8484
os.Exit(1)
8585
}
8686

87-
storage := mustInitStorage(storagePath, setupLog)
87+
storage := mustInitStorage(storagePath, storageAddr, setupLog)
8888

8989
go startFileServer(storage.BasePath, storageAddr, setupLog)
9090

@@ -135,13 +135,14 @@ func startFileServer(path string, address string, l logr.Logger) {
135135
}
136136
}
137137

138-
func mustInitStorage(path string, l logr.Logger) *controllers.Storage {
138+
func mustInitStorage(path string, storageAddr string, l logr.Logger) *controllers.Storage {
139139
if path == "" {
140140
p, _ := os.Getwd()
141141
path = filepath.Join(p, "bin")
142+
os.MkdirAll(path, 0777)
142143
}
143144

144-
hostname := "localhost"
145+
hostname := "localhost" + storageAddr
145146
if os.Getenv("RUNTIME_NAMESPACE") != "" {
146147
svcParts := strings.Split(os.Getenv("HOSTNAME"), "-")
147148
hostname = fmt.Sprintf("%s.%s",

0 commit comments

Comments
 (0)