1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 23:46:56 +00:00
kyverno/pkg/engine/variables/common.go
shuting da943325fe
Ignore auto-gen annotation on Pod when processing DENY rule (#944)
* ignore auto-gen annotation on Pod when processing DENY rule

* remove unused code
2020-06-24 10:26:04 -07:00

12 lines
287 B
Go

package variables
import (
"regexp"
)
//IsVariable returns true if the element contains a 'valid' variable {{}}
func IsVariable(element string) bool {
validRegex := regexp.MustCompile(variableRegex)
groups := validRegex.FindAllStringSubmatch(element, -1)
return len(groups) != 0
}