Add more tests, refactor to fix problems

Signed-off-by: Patrice Ferlet <metal3d@gmail.com>
This commit is contained in:
2024-04-24 20:55:27 +02:00
parent 15a2f25e51
commit da7d92bbfa
8 changed files with 429 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import (
"log"
"strings"
labelstructs "katenary/generator/labelStructs"
"katenary/utils"
"github.com/compose-spec/compose-go/types"
@@ -31,17 +32,18 @@ func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (
if !ok {
return nil, nil
}
mapping := struct {
Image string `yaml:"image,omitempty"`
Command string `yaml:"command"`
Schedule string `yaml:"schedule"`
Rbac bool `yaml:"rbac"`
}{
Image: "",
Command: "",
Schedule: "",
Rbac: false,
}
//mapping := struct {
// Image string `yaml:"image,omitempty"`
// Command string `yaml:"command"`
// Schedule string `yaml:"schedule"`
// Rbac bool `yaml:"rbac"`
//}{
// Image: "",
// Command: "",
// Schedule: "",
// Rbac: false,
//}
var mapping labelstructs.CronJob
if err := goyaml.Unmarshal([]byte(labels), &mapping); err != nil {
log.Fatalf("Error parsing cronjob labels: %s", err)
return nil, nil