Code cleaning

Using gofumpt. Add documentation.
Some fixes on type checking and const icon type declaration.
This commit is contained in:
2024-04-05 07:56:27 +02:00
parent 2aad5d4b9d
commit 441b30a570
16 changed files with 86 additions and 93 deletions

View File

@@ -1,10 +1,11 @@
package generator
import (
"katenary/utils"
"log"
"strings"
"katenary/utils"
"github.com/compose-spec/compose-go/types"
goyaml "gopkg.in/yaml.v3"
networkv1 "k8s.io/api/networking/v1"
@@ -21,7 +22,6 @@ type Ingress struct {
// NewIngress creates a new Ingress from a compose service.
func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress {
appName := Chart.Name
// parse the KATENARY_PREFIX/ingress label from the service
@@ -73,7 +73,7 @@ func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress {
Annotations: map[string]string{},
}
//ingressClassName := `{{ .Values.` + service.Name + `.ingress.class }}`
// ingressClassName := `{{ .Values.` + service.Name + `.ingress.class }}`
ingressClassName := utils.TplValue(service.Name, "ingress.class")
servicePortName := utils.GetServiceNameByPort(int(mapping["port"].(int32)))
@@ -173,7 +173,6 @@ func (ingress *Ingress) Yaml() ([]byte, error) {
out = append(out, `{{- end -}}`)
ret = []byte(strings.Join(out, "\n"))
return ret, nil
}
func (ingress *Ingress) Filename() string {