Exemple #1
0
// Matches returns true if the resource ID matches the glob from cfg.
func (res *Resource) Matches(cfg *pb.ResourceTemplate) bool {
	// NOTE(ryszard): The only possible error from Match is for a
	// malformed pattern, so it is safe to quench it (especially
	// that the config validation should have found any malformed
	// patterns).
	glob := cfg.GetIdentifierGlob()
	matches, _ := filepath.Match(glob, res.ID)
	return glob == res.ID || matches
}