diff --git a/internal/app/main.go b/internal/app/main.go index 4974c125..f710195e 100644 --- a/internal/app/main.go +++ b/internal/app/main.go @@ -34,10 +34,18 @@ func Main() { flags.readState(&s) if len(s.GroupMap) > 0 { s.TargetMap = s.getAppsInGroupsAsTargetMap() + if len(s.TargetMap) == 0 { + log.Info("No apps defined with -group flag were found, exiting...") + os.Exit(0) + } } if len(s.TargetMap) > 0 { s.TargetApps = s.getAppsInTargetsOnly() s.TargetNamespaces = s.getNamespacesInTargetsOnly() + if len(s.TargetApps) == 0 { + log.Info("No apps defined with -target flag were found, exiting...") + os.Exit(0) + } } settings = s.Settings curContext = s.Context