From ae0c09a05c7fa172a60fbe2e4d8663d437ec4b0e Mon Sep 17 00:00:00 2001 From: Jim Bugwadia Date: Wed, 14 Oct 2020 18:48:23 -0700 Subject: [PATCH] remove ContextEntry.path (prototype for API server lookup) --- pkg/api/kyverno/v1/types.go | 1 - pkg/policy/validate.go | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) 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")