mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-09 15:26:41 +02:00
fix(hook): event hooks should run on remote charts, too (#364)
And fixed the bug that "diff" was not triggering "prepare" hooks. Ref #363
This commit is contained in:
@@ -183,6 +183,10 @@ func main() {
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
return findAndIterateOverDesiredStatesUsingFlags(c, func(state *state.HelmState, helm helmexec.Interface) []error {
|
||||
if errs := state.PrepareRelease(helm, "diff"); errs != nil && len(errs) > 0 {
|
||||
return errs
|
||||
}
|
||||
|
||||
_, errs := executeDiffCommand(c, state, helm, c.Bool("detailed-exitcode"), c.Bool("suppress-secrets"))
|
||||
return errs
|
||||
})
|
||||
|
||||
+2
-5
@@ -826,11 +826,8 @@ func (state *HelmState) PrepareRelease(helm helmexec.Interface, helmfileCommand
|
||||
errs := []error{}
|
||||
|
||||
for _, release := range state.Releases {
|
||||
if isLocalChart(release.Chart) {
|
||||
if _, err := state.triggerPrepareEvent(&release, helmfileCommand); err != nil {
|
||||
errs = append(errs, &ReleaseError{&release, err})
|
||||
continue
|
||||
}
|
||||
if _, err := state.triggerPrepareEvent(&release, helmfileCommand); err != nil {
|
||||
errs = append(errs, &ReleaseError{&release, err})
|
||||
}
|
||||
}
|
||||
if len(errs) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user