Skip to content

Commit

Permalink
Add exiting on empty apps list for -target or -group flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Kubaczyk committed Feb 1, 2020
1 parent e29d3e7 commit 450c15f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 450c15f

Please sign in to comment.