Use compose-go https://github.com/compose-spec/compose-go to make Katenary parsing compose file the official way. Add labels: - `volume-from` (with `same-pod`) to avoid volume repetition - `ignore` to ignore a service - `mapenv` (replaces the `env-to-service`) to map environment to helm variable (as a template string) - `secret-vars` declares variables as secret values More: - Now, environment (as secret vars) are set in values.yaml - Ingress has got annotations in values.yaml - Probes (liveness probe) are improved - fixed code to optimize - many others fixes about path, bad volume check, refactorisation, tests...
19 lines
368 B
Go
19 lines
368 B
Go
package writers
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
// BuildConfigMap writes the configMap.
|
|
func BuildConfigMap(c interface{}, kind, servicename, name, templatesDir string) {
|
|
fname := filepath.Join(templatesDir, name+"."+kind+".yaml")
|
|
fp, _ := os.Create(fname)
|
|
enc := yaml.NewEncoder(fp)
|
|
enc.SetIndent(IndentSize)
|
|
enc.Encode(c)
|
|
fp.Close()
|
|
}
|