mirror of
https://github.com/helm/helm.git
synced 2026-02-20 16:35:55 -05:00
updated comment and made defer of shutdown function return errors as before and not the possible shutdown error
Signed-off-by: Michelle Fernandez Bieber <mfbieber@gmail.com>
This commit is contained in:
parent
7a557580e1
commit
10714772be
2 changed files with 12 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ func ShutdownNoOp() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// execHook executes all of the hooks for the given hook event and return a shutdownHook function to trigger deletions after doing other things like e.g. retrieving logs.
|
||||
// execHook executes all of the hooks for the given hook event and returns a shutdownHook function to trigger deletions after doing other things like e.g. retrieving logs.
|
||||
func (cfg *Configuration) execHookWithDelayedShutdown(rl *release.Release, hook release.HookEvent, waitStrategy kube.WaitStrategy, timeout time.Duration, serverSideApply bool) (ExecuteShutdownHooks, error) {
|
||||
executingHooks := []*release.Hook{}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ func newReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command
|
|||
}
|
||||
return compListReleases(toComplete, args, cfg)
|
||||
},
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, args []string) (returnError error) {
|
||||
client.Namespace = settings.Namespace()
|
||||
notName := regexp.MustCompile(`^!\s?name=`)
|
||||
for _, f := range filter {
|
||||
|
|
@ -65,8 +65,17 @@ func newReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command
|
|||
client.Filters[action.ExcludeNameFilter] = append(client.Filters[action.ExcludeNameFilter], notName.ReplaceAllLiteralString(f, ""))
|
||||
}
|
||||
}
|
||||
|
||||
reli, shutdown, runErr := client.Run(args[0])
|
||||
defer shutdown()
|
||||
defer func() {
|
||||
if shutdownErr := shutdown(); shutdownErr != nil {
|
||||
if returnError == nil {
|
||||
returnError = shutdownErr
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
// We only return an error if we weren't even able to get the
|
||||
// release, otherwise we keep going so we can print status and logs
|
||||
// if requested
|
||||
|
|
|
|||
Loading…
Reference in a new issue