From 03aae67a4282f5a75631f46ee9bdac13c581c9b3 Mon Sep 17 00:00:00 2001 From: mustard Date: Mon, 14 Nov 2022 05:38:58 +0000 Subject: [PATCH] [supervisor] don't swallow supervisor exit error --- components/supervisor/cmd/init.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/supervisor/cmd/init.go b/components/supervisor/cmd/init.go index 631a63335d1150..5ebe24cbcc06ef 100644 --- a/components/supervisor/cmd/init.go +++ b/components/supervisor/cmd/init.go @@ -60,6 +60,9 @@ var initCmd = &cobra.Command{ err := runCommand.Wait() if err != nil && !(strings.Contains(err.Error(), "signal: interrupt") || strings.Contains(err.Error(), "no child processes")) { + if eerr, ok := err.(*exec.ExitError); ok && eerr.ExitCode() != 0 { + log.WithError(err).Fatal("supervisor run error with unexpected exit code") + } log.WithError(err).Error("supervisor run error") return }