diff --git a/pkg/api/kyverno/v1/types.go b/pkg/api/kyverno/v1/types.go index 675c8e6cd6..b55db92b88 100644 --- a/pkg/api/kyverno/v1/types.go +++ b/pkg/api/kyverno/v1/types.go @@ -194,7 +194,6 @@ type Rule struct { type ContextEntry struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` ConfigMap *ConfigMapReference `json:"configMap,omitempty" yaml:"configMap,omitempty"` } diff --git a/pkg/policy/validate.go b/pkg/policy/validate.go index 8e85abcef7..7946f73a7d 100644 --- a/pkg/policy/validate.go +++ b/pkg/policy/validate.go @@ -458,11 +458,7 @@ func validateRuleContext(rule kyverno.Rule) (error) { if entry.Name == ""{ return fmt.Errorf("a name is required for context entries") } - - if entry.Path == "" && entry.ConfigMap == nil { - return fmt.Errorf("path or configMap required for context entries") - } - + if entry.ConfigMap != nil { if entry.ConfigMap.Name == "" { return fmt.Errorf("a name is required for configMap context entry")