Merge pull request #1754 from AhmedGrati/fix-annotations-disable

fix: disable annotations when flag `--with-kompose-annotation=false` is specified
This commit is contained in:
Kubernetes Prow Robot
2023-11-07 04:16:35 +01:00
committed by GitHub
23 changed files with 4 additions and 379 deletions
+4 -3
View File
@@ -248,14 +248,15 @@ func ConfigAllLabels(name string, service *kobject.ServiceConfig) map[string]str
// ConfigAnnotations configures annotations
func ConfigAnnotations(service kobject.ServiceConfig) map[string]string {
annotations := map[string]string{}
for key, value := range service.Annotations {
annotations[key] = value
}
if !service.WithKomposeAnnotation {
return annotations
}
for key, value := range service.Annotations {
annotations[key] = value
}
annotations["kompose.cmd"] = strings.Join(os.Args, " ")
versionCmd := exec.Command("kompose", "version")
out, err := versionCmd.Output()