fix: dont overwrite label when chaos

See #668
This commit is contained in:
2025-09-29 18:48:08 +02:00
parent c92a0d0703
commit 3696d63a34

View File

@ -3,6 +3,7 @@ package app
import (
"context"
"errors"
"fmt"
"strings"
"coopcloud.tech/abra/cli/internal"
@ -159,7 +160,18 @@ checkout as-is. Recipe commit hashes are also supported as values for
appPkg.SetChaosVersionLabel(compose, stackName, toDeployVersion)
}
appPkg.SetUpdateLabel(compose, stackName, app.Env)
appPkg.SetVersionLabel(compose, stackName, toDeployVersion)
versionLabel := toDeployVersion
if internal.Chaos {
for _, service := range compose.Services {
if service.Name == "app" {
labelKey := fmt.Sprintf("coop-cloud.%s.version", stackName)
// NOTE(d1): keep non-chaos version labbeling when doing chaos ops
versionLabel = service.Deploy.Labels[labelKey]
}
}
}
appPkg.SetVersionLabel(compose, stackName, versionLabel)
envVars, err := appPkg.CheckEnv(app)
if err != nil {