DodoApp: Prepare dodo-app to support multiple app repositories
Previously Git repository storing configuration for PCloud
environment, linked dodo-app repositories directly. After this change,
dodo-app will first create config repository which will link
individual application repositories. And PCloud env will link to the
config repo. That way dodo-app manger will be able to create multiple
app repositories per installation.
Change-Id: I647cacda7a9a4f241d2acc28ae5d8bbd8c6424d6
diff --git a/core/installer/app_test.go b/core/installer/app_test.go
index 559de31..db8d5b8 100644
--- a/core/installer/app_test.go
+++ b/core/installer/app_test.go
@@ -316,9 +316,36 @@
}
_, err = app.Render(release, env, map[string]any{
"repoAddr": "",
+ "appId": "",
"sshPrivateKey": "",
}, nil)
if err != nil {
t.Fatal(err)
}
}
+
+func TestDodoAppInstance(t *testing.T) {
+ r := NewInMemoryAppRepository(CreateAllApps())
+ a, err := FindEnvApp(r, "dodo-app-instance")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if a == nil {
+ t.Fatal("returned app is nil")
+ }
+ release := Release{
+ Namespace: "foo",
+ }
+ values := map[string]any{
+ "appName": "",
+ "repoAddr": "",
+ "gitRepoPublicKey": "",
+ }
+ rendered, err := a.Render(release, env, values, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, r := range rendered.Resources {
+ t.Log(string(r))
+ }
+}