remove marathon labels from gendoc

This commit is contained in:
Baptiste Mayelle 2024-01-17 14:54:05 +01:00 committed by GitHub
parent 111f3716fa
commit 64ff214ff8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 234 deletions

View file

@ -121,30 +121,13 @@ func labelsWrite(outputDir string, element *dynamic.Configuration) error {
return err
}
marathonLabels, err := os.Create(filepath.Join(outputDir, "marathon-labels.json"))
if err != nil {
return err
}
defer marathonLabels.Close()
// Write the comment at the beginning of the file
if _, err := marathonLabels.WriteString(strings.ReplaceAll(commentGenerated, "##", "//")); err != nil {
return err
}
for i, k := range keys {
for _, k := range keys {
v := labels[k]
if v != "" {
if v == "42000000000" {
v = "42s"
}
fmt.Fprintln(dockerLabels, `- "`+strings.ToLower(k)+`=`+v+`"`)
if i == len(keys)-1 {
fmt.Fprintln(marathonLabels, `"`+strings.ToLower(k)+`": "`+v+`"`)
} else {
fmt.Fprintln(marathonLabels, `"`+strings.ToLower(k)+`": "`+v+`",`)
}
}
}