Files
katenary/generator/writers/configmap.go

18 lines
344 B
Go

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)
enc.SetIndent(IndentSize)
enc.Encode(c)
fp.Close()
}