1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Change error reporting in get.go from logger.Failure to fmt.Errorf to give non 0 exit code

Signed-off-by: Daniel Guns <danbguns@gmail.com>
This commit is contained in:
Daniel Guns
2025-05-06 19:30:57 -03:00
parent 6af448e037
commit 392a33d425
2 changed files with 79 additions and 3 deletions

View File

@@ -184,13 +184,13 @@ func (get getCommand) run(cmd *cobra.Command, args []string) error {
if get.list.len() == 0 {
if len(args) > 0 {
logger.Failuref("%s object '%s' not found in %s namespace",
return fmt.Errorf("%s object '%s' not found in %s namespace",
get.kind,
args[0],
namespaceNameOrAny(getArgs.allNamespaces, *kubeconfigArgs.Namespace),
)
} else if !getAll {
logger.Failuref("no %s objects found in %s namespace",
return fmt.Errorf("no %s objects found in %s namespace",
get.kind,
namespaceNameOrAny(getArgs.allNamespaces, *kubeconfigArgs.Namespace),
)