Fixup configMap names + add logs
This commit is contained in:
@@ -43,7 +43,11 @@ func CreateReplicaObject(name string, s compose.Service) (ret []interface{}) {
|
|||||||
container := helm.NewContainer(name, s.Image, s.Environment, s.Labels)
|
container := helm.NewContainer(name, s.Image, s.Environment, s.Labels)
|
||||||
|
|
||||||
for _, envfile := range s.EnvFiles {
|
for _, envfile := range s.EnvFiles {
|
||||||
configMap := helm.NewConfigMap(name)
|
f := strings.ReplaceAll(envfile, "_", "-")
|
||||||
|
f = strings.ReplaceAll(f, ".env", "")
|
||||||
|
cf := f + "-" + name
|
||||||
|
Bluef("Generating configMap %s\n", cf)
|
||||||
|
configMap := helm.NewConfigMap(cf)
|
||||||
if err := configMap.AddEnvFile(envfile); err != nil {
|
if err := configMap.AddEnvFile(envfile); err != nil {
|
||||||
Red(err.Error())
|
Red(err.Error())
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
@@ -55,6 +59,7 @@ func CreateReplicaObject(name string, s compose.Service) (ret []interface{}) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
ret = append(ret, configMap)
|
ret = append(ret, configMap)
|
||||||
|
Greenf("Done configMap %s\n", cf)
|
||||||
}
|
}
|
||||||
|
|
||||||
container.Image = "{{ .Values." + name + ".image }}"
|
container.Image = "{{ .Values." + name + ".image }}"
|
||||||
|
@@ -3,7 +3,6 @@ package helm
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,7 +34,6 @@ func (c *ConfigMap) AddEnvFile(file string) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
parts := strings.SplitN(l, "=", 2)
|
parts := strings.SplitN(l, "=", 2)
|
||||||
log.Printf("%d %v\n", len(parts), parts)
|
|
||||||
if len(parts) < 2 {
|
if len(parts) < 2 {
|
||||||
return errors.New("The environment file " + file + " is not valid")
|
return errors.New("The environment file " + file + " is not valid")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user