feat: colorized DELETED (#1944)

feat: colorize DELETED

Signed-off-by: Eric Bailey <eric@ericb.me>
This commit is contained in:
Eric Bailey
2025-02-19 12:30:02 +08:00
committed by GitHub
parent 82a2f7ed2f
commit 156a7576b5
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -7,6 +7,8 @@ import (
"sort"
"strings"
"github.com/fatih/color"
"github.com/helmfile/helmfile/pkg/helmexec"
"github.com/helmfile/helmfile/pkg/state"
)
@@ -216,7 +218,11 @@ func (r *Run) diff(triggerCleanupEvent bool, detailedExitCode bool, c DiffConfig
names = append(names, fmt.Sprintf(" %s (%s) UPDATED", r.Name, r.Chart))
}
for _, r := range releasesToBeDeleted {
names = append(names, fmt.Sprintf(" %s (%s) DELETED", r.Name, r.Chart))
releaseToBeDeleted := fmt.Sprintf(" %s (%s) DELETED", r.Name, r.Chart)
if c.Color() {
releaseToBeDeleted = color.RedString(releaseToBeDeleted)
}
names = append(names, releaseToBeDeleted)
}
// Make the output deterministic for testing purpose
sort.Strings(names)