From a7781b169df929028f2d4e4fe2f6b297aede60e5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 11 Jun 2017 22:27:20 +0200 Subject: fix templater: Ignore slash-suffixes on includes/excludes To prevent situations where a shell auto-appends a slash to an include/exclude specification on the CLI, trailing slashes in those string lists are now trimmed. This fixes #54 --- templater/templater.go | 1 + 1 file changed, 1 insertion(+) (limited to 'templater') diff --git a/templater/templater.go b/templater/templater.go index 9054ebac4089..4d9a04eb2d16 100644 --- a/templater/templater.go +++ b/templater/templater.go @@ -163,6 +163,7 @@ func applyLimits(rs *[]context.ResourceSet, include *[]string, exclude *[]string // Check whether an include/exclude string slice matches a resource set func matchesResourceSet(s *[]string, rs *context.ResourceSet) bool { for _, r := range *s { + r = strings.TrimSuffix(r, "/") if r == rs.Name || r == rs.Parent { return true } -- cgit 1.4.1