mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 05:45:56 +02:00
Fix interactive apply asks in no change situation (#945)
This commit makes the apply logic exit early in the event there are no changes to releases. I believe this effectively reverts helmfile#522. Updates relevant snapshots Clarify conditions under which preapply hooks are triggered to include that they will no longer fire if there is a no-op. Docs as requested by the maintainer from a copilot request made by them. Fixes: helmfile#679 Signed-off-by: Thomas Arrow <thomas.arrow@wikimedia.de> Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
@@ -1704,6 +1704,10 @@ Do you really want to apply?
|
||||
// Traverse DAG of all the releases so that we don't suffer from false-positive missing dependencies
|
||||
st.Releases = selectedAndNeededReleases
|
||||
|
||||
if len(releasesToBeUpdated) == 0 && len(releasesToBeDeleted) == 0 {
|
||||
return true, false, nil
|
||||
}
|
||||
|
||||
if !interactive || interactive && r.askForConfirmation(confMsg) {
|
||||
if _, preapplyErrors := withDAG(st, helm, a.Logger, state.PlanOptions{Purpose: "invoking preapply hooks for", Reverse: true, SelectedReleases: toApplyWithNeeds, SkipNeeds: true}, a.WrapWithoutSelector(func(subst *state.HelmState, helm helmexec.Interface) []error {
|
||||
for _, r := range subst.Releases {
|
||||
|
||||
@@ -2,8 +2,3 @@ merged environment: &{default map[] map[] map[]}
|
||||
2 release(s) found in helmfile.yaml
|
||||
|
||||
Checking release existence using `helm status` for release foo_notFound
|
||||
invoking preapply hooks for 1 groups of releases in this order:
|
||||
GROUP RELEASES
|
||||
1 default//bar, default//foo_notFound
|
||||
|
||||
invoking preapply hooks for releases in group 1/1: default//bar, default//foo_notFound
|
||||
|
||||
Vendored
-7
@@ -1,10 +1,3 @@
|
||||
merged environment: &{default map[] map[] map[]}
|
||||
2 release(s) found in helmfile.yaml
|
||||
|
||||
invoking preapply hooks for 2 groups of releases in this order:
|
||||
GROUP RELEASES
|
||||
1 default//foo
|
||||
2 default//bar
|
||||
|
||||
invoking preapply hooks for releases in group 1/2: default//foo
|
||||
invoking preapply hooks for releases in group 2/2: default//bar
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
|
||||
hook[prepare] logs | foo
|
||||
hook[prepare] logs |
|
||||
|
||||
hook[preapply] logs | foo
|
||||
hook[preapply] logs |
|
||||
|
||||
hook[cleanup] logs | foo
|
||||
hook[cleanup] logs |
|
||||
|
||||
Reference in New Issue
Block a user