mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 09:38:50 +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:
parent
6af448e037
commit
392a33d425
2 changed files with 79 additions and 3 deletions
|
|
@ -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),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue