feat templater: Warn if no valid resource sets are included
After filtering resource sets, check whether any resource sets "survived". Otherwise it can be assumed that the user specified invalid exclude/include combinations and should be warned about that. Fixes #35
This commit is contained in:
parent
7286751db7
commit
32ca64c50a
1 changed files with 5 additions and 0 deletions
|
@ -33,6 +33,11 @@ type TemplatingError struct {
|
|||
func LoadAndPrepareTemplates(include *[]string, exclude *[]string, c *context.Context) (output []string, err error) {
|
||||
limitedResourceSets := applyLimits(&c.ResourceSets, include, exclude)
|
||||
|
||||
if len(*limitedResourceSets) == 0 {
|
||||
fmt.Fprintln(os.Stderr, "No valid resource sets included!")
|
||||
return
|
||||
}
|
||||
|
||||
for _, rs := range *limitedResourceSets {
|
||||
err = processResourceSet(c, &rs, &output)
|
||||
|
||||
|
|
Loading…
Reference in a new issue