installer-env: wait for services to be reachable
diff --git a/core/installer/repoio.go b/core/installer/repoio.go
index 204caec..ca47731 100644
--- a/core/installer/repoio.go
+++ b/core/installer/repoio.go
@@ -9,6 +9,7 @@
"net"
"path"
"path/filepath"
+ "sync"
"time"
"github.com/go-git/go-billy/v5/util"
@@ -45,12 +46,14 @@
type repoIO struct {
repo *soft.Repository
signer ssh.Signer
+ l sync.Locker
}
func NewRepoIO(repo *soft.Repository, signer ssh.Signer) RepoIO {
return &repoIO{
repo,
signer,
+ &sync.Mutex{},
}
}
@@ -233,6 +236,8 @@
}
func (r *repoIO) InstallApp(app App, appRootDir string, values map[string]any, derived Derived) error {
+ r.l.Lock()
+ defer r.l.Unlock()
if !filepath.IsAbs(appRootDir) {
return fmt.Errorf("Expected absolute path: %s", appRootDir)
}
@@ -292,6 +297,8 @@
}
func (r *repoIO) RemoveApp(appRootDir string) error {
+ r.l.Lock()
+ defer r.l.Unlock()
r.RemoveDir(appRootDir)
parent, child := filepath.Split(appRootDir)
kustPath := filepath.Join(parent, "kustomization.yaml")