diff --git a/pkg/grizzly/providers.go b/pkg/grizzly/providers.go index 9106ac61..d087ac56 100644 --- a/pkg/grizzly/providers.go +++ b/pkg/grizzly/providers.go @@ -140,7 +140,11 @@ func (r *Resource) MatchesTarget(targets []string) bool { dotKey := r.Key() slashKey := fmt.Sprintf("%s/%s", r.Kind(), UID) for _, target := range targets { - g := glob.MustCompile(target) + g, err := glob.Compile(target) + if err != nil { + continue + } + if g.Match(slashKey) || g.Match(dotKey) { return true } diff --git a/pkg/grizzly/registry.go b/pkg/grizzly/registry.go index 02451034..a0094118 100644 --- a/pkg/grizzly/registry.go +++ b/pkg/grizzly/registry.go @@ -75,7 +75,11 @@ func (r *registry) ResourceMatchesTarget(handler Handler, UID string, targets [] slashKey := fmt.Sprintf("%s/%s", handler.Kind(), UID) dotKey := fmt.Sprintf("%s.%s", handler.Kind(), UID) for _, target := range targets { - g := glob.MustCompile(target) + g, err := glob.Compile(target) + if err != nil { + continue + } + if g.Match(slashKey) || g.Match(dotKey) { return true }