mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 01:31:36 +02:00
chore: Emit "cleanup" events later to match the behavior in "apply" (#2522)
This changes the behaviour of the cleanup event during sync to be triggered right before the function exits and matches the behaviour of apply Signed-off-by: Niklas Ott <niklas.ott@unwired.at> Co-authored-by: Raphael Luba <raphael@leanbyte.com>
This commit is contained in:
+7
-7
@@ -2269,13 +2269,6 @@ func (a *App) SyncState(r *Run, c SyncConfigProvider) (bool, []error) {
|
||||
}
|
||||
}
|
||||
|
||||
for id := range releasesWithNoChange {
|
||||
r := releasesWithNoChange[id]
|
||||
if _, err := st.TriggerCleanupEvent(&r, "sync"); err != nil {
|
||||
a.Logger.Warnf("warn: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
names := []string{}
|
||||
for _, r := range releasesToUpdate {
|
||||
names = append(names, fmt.Sprintf(" %s (%s) UPDATED", r.Name, r.Chart))
|
||||
@@ -2378,6 +2371,13 @@ Do you really want to sync?
|
||||
|
||||
affectedReleases.DisplayAffectedReleases(c.Logger())
|
||||
|
||||
for id := range releasesWithNoChange {
|
||||
r := releasesWithNoChange[id]
|
||||
if _, err := st.TriggerCleanupEvent(&r, "sync"); err != nil {
|
||||
a.Logger.Warnf("warn: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
return true, errs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user