Files
katenary/generator/writers/configmap.go

19 lines
368 B
Go
Raw Normal View History

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()
}