Fix ingress

This commit is contained in:
2021-11-30 12:09:07 +01:00
parent f095f39eaf
commit 069cddcdc0
3 changed files with 11 additions and 8 deletions

11
main.go
View File

@@ -2,12 +2,12 @@ package main
import (
"flag"
"fmt"
"helm-compose/compose"
"helm-compose/generator"
"helm-compose/helm"
"os"
"path/filepath"
"strings"
"sync"
"gopkg.in/yaml.v3"
@@ -45,6 +45,7 @@ func main() {
for n, f := range files {
for _, c := range f {
kind := c.(helm.Kinded).Get()
kind = strings.ToLower(kind)
fname := filepath.Join(templatesDir, n+"."+kind+".yaml")
fp, _ := os.Create(fname)
enc := yaml.NewEncoder(fp)
@@ -54,12 +55,14 @@ func main() {
}
}
for _, ing := range generator.Ingresses {
for name, ing := range generator.Ingresses {
fmt.Println("---")
enc := yaml.NewEncoder(os.Stdout)
fname := filepath.Join(templatesDir, name+".ingress.yaml")
fp, _ := os.Create(fname)
enc := yaml.NewEncoder(fp)
enc.SetIndent(2)
enc.Encode(ing)
fp.Close()
}
enc := yaml.NewEncoder(os.Stdout)