DodoApp: Return env vars on install/update
Pass service namespace as env var as well.
Fix llm-api-key flag.
Change-Id: Iff8c845c4a1b62eb4940463a62eb32487abd5992
diff --git a/core/installer/app.go b/core/installer/app.go
index f9d3bc0..9719134 100644
--- a/core/installer/app.go
+++ b/core/installer/app.go
@@ -135,6 +135,11 @@
Password string `json:"password"`
}
+type EnvVar struct {
+ Name string `json:"name"`
+ Value string `json:"value"`
+}
+
type rendered struct {
Name string
Readme string
@@ -150,6 +155,7 @@
Help []HelpDocument
Icon string
Access []Access
+ EnvVars []EnvVar
Raw []byte
}
@@ -475,6 +481,19 @@
return rendered{}, err
}
{
+ envVars := []string{}
+ if err := res.LookupPath(cue.ParsePath("envVars")).Decode(&envVars); err != nil {
+ return rendered{}, err
+ }
+ for _, ev := range envVars {
+ items := strings.SplitN(ev, "=", 2)
+ if len(items) != 2 {
+ panic(ev)
+ }
+ ret.EnvVars = append(ret.EnvVars, EnvVar{items[0], items[1]})
+ }
+ }
+ {
charts := res.LookupPath(cue.ParsePath("output.charts"))
i, err := charts.Fields()
if err != nil {