EnvManager: fix race condition in test
Refactor EnvManager so it takes TaskManager as an input.
This way clients can interject created tasks and install listeners.
Change-Id: Ief332060aea9e98587b43d04d68a4640717d18cd
diff --git a/core/installer/cmd/env_manager.go b/core/installer/cmd/env_manager.go
index e6b8499..aa33de8 100644
--- a/core/installer/cmd/env_manager.go
+++ b/core/installer/cmd/env_manager.go
@@ -9,6 +9,7 @@
"github.com/giolekva/pcloud/core/installer/dns"
"github.com/giolekva/pcloud/core/installer/http"
"github.com/giolekva/pcloud/core/installer/soft"
+ "github.com/giolekva/pcloud/core/installer/tasks"
"github.com/giolekva/pcloud/core/installer/welcome"
)
@@ -86,6 +87,7 @@
installer.NewFixedLengthRandomNameGenerator(4),
httpClient,
dns.NewClient(),
+ tasks.NewTaskMap(),
)
log.Printf("Starting server\n")
s.Start()