chore(refacto): fix secret and use katenary schema

- add possibility to use a katenary.yaml file to setup values
- fix secret generation
This commit is contained in:
2024-11-18 17:12:12 +01:00
parent 14877fbfa3
commit cc1019b5a8
39 changed files with 375 additions and 155 deletions

View File

@@ -1,7 +1,8 @@
package generator
import (
"katenary/generator/labelStructs"
"katenary/generator/labels"
"katenary/generator/labels/labelStructs"
"katenary/utils"
"regexp"
"strconv"
@@ -46,7 +47,7 @@ func fixPorts(service *types.ServiceConfig) error {
// check the "ports" label from container and add it to the service
portsLabel := ""
ok := false
if portsLabel, ok = service.Labels[LabelPorts]; !ok {
if portsLabel, ok = service.Labels[labels.LabelPorts]; !ok {
return nil
}
ports, err := labelStructs.PortsFrom(portsLabel)
@@ -75,7 +76,7 @@ func fixPorts(service *types.ServiceConfig) error {
// isIgnored returns true if the service is ignored.
func isIgnored(service types.ServiceConfig) bool {
if v, ok := service.Labels[LabelIgnore]; ok {
if v, ok := service.Labels[labels.LabelIgnore]; ok {
return v == "true" || v == "yes" || v == "1"
}
return false