2021-12-05 10:13:11 +01:00
|
|
|
package writers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"gopkg.in/yaml.v3"
|
|
|
|
)
|
|
|
|
|
|
|
|
func BuildConfigMap(c interface{}, kind, servicename, name, templatesDir string) {
|
|
|
|
fname := filepath.Join(templatesDir, servicename+"."+name+"."+kind+".yaml")
|
|
|
|
fp, _ := os.Create(fname)
|
|
|
|
enc := yaml.NewEncoder(fp)
|
2022-02-16 10:56:21 +01:00
|
|
|
enc.SetIndent(IndentSize)
|
2021-12-05 10:13:11 +01:00
|
|
|
enc.Encode(c)
|
|
|
|
fp.Close()
|
|
|
|
}
|