Skip to content

Commit

Permalink
fix: cleanup also in the render-and-sync function
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebradil committed Nov 21, 2023
1 parent 7092cf2 commit 65ee40f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/myks/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (e *Environment) SyncAndRender(asyncLevel int, vendirSecrets string) error
if err := e.renderArgoCD(); err != nil {
return err
}
return process(asyncLevel, e.Applications, func(item interface{}) error {
err := process(asyncLevel, e.Applications, func(item interface{}) error {
app, ok := item.(*Application)
if !ok {
return fmt.Errorf("Unable to cast item to *Application")
Expand All @@ -129,6 +129,12 @@ func (e *Environment) SyncAndRender(asyncLevel int, vendirSecrets string) error
}
return app.renderArgoCD()
})
if err != nil {
log.Error().Err(err).Msg(e.Msg("Unable to sync and render applications"))
return err
}

return e.Cleanup()
}

func (e *Environment) Cleanup() error {
Expand Down

0 comments on commit 65ee40f

Please sign in to comment.