From e3d6717387605d7b8936a18ea012bd636c3d676d Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:17:06 +0200 Subject: [PATCH] update comment and explain why we use cmdutil.CheckErr Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- cmd/ctl/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ctl/main.go b/cmd/ctl/main.go index f28f57aae..4a7a0196c 100644 --- a/cmd/ctl/main.go +++ b/cmd/ctl/main.go @@ -37,7 +37,8 @@ func main() { logf.InitLogs() defer logf.FlushLogs() - // In cmctl, we are using cmdutil.CheckErr, which will call os.Exit(1) if it receives an error. + // In cmctl, we are using cmdutil.CheckErr, a kubectl utility function that creates human readable + // error messages from errors. By default, this function will call os.Exit(1) if it receives an error. // Instead, we want to do a soft exit, and use SetExitCode to set the correct exit code. // Additionally, we make sure to output the final error message to stdout, as we do not want this // message to be mixed with other log outputs from the execution of the command.