diff --git a/pkg/engine/variables/validatevariables.go b/pkg/engine/variables/validatevariables.go index f5c428ee01..78e9d687d6 100644 --- a/pkg/engine/variables/validatevariables.go +++ b/pkg/engine/variables/validatevariables.go @@ -4,6 +4,7 @@ import ( "regexp" "strings" + "github.com/golang/glog" "github.com/nirmata/kyverno/pkg/engine/context" ) @@ -14,6 +15,7 @@ func ValidateVariables(ctx context.EvalInterface, pattern interface{}) string { variableList := extractVariables(pattern) for i := 0; i < len(variableList)-1; i = i + 2 { p := variableList[i+1] + glog.V(3).Infof("validating variables %s", p) val, err := ctx.Query(p) // reference path is not present if err == nil && val == nil { diff --git a/pkg/webhooks/generation.go b/pkg/webhooks/generation.go index 199178ce52..3929f6e330 100644 --- a/pkg/webhooks/generation.go +++ b/pkg/webhooks/generation.go @@ -41,6 +41,7 @@ func (ws *WebhookServer) HandleGenerate(request *v1beta1.AdmissionRequest, polic policyContext := engine.PolicyContext{ NewResource: *resource, AdmissionInfo: userRequestInfo, + Context: ctx, } // engine.Generate returns a list of rules that are applicable on this resource diff --git a/pkg/webhooks/mutation.go b/pkg/webhooks/mutation.go index 4103b1a5e5..7193661630 100644 --- a/pkg/webhooks/mutation.go +++ b/pkg/webhooks/mutation.go @@ -71,6 +71,7 @@ func (ws *WebhookServer) HandleMutation(request *v1beta1.AdmissionRequest, resou policyContext := engine.PolicyContext{ NewResource: resource, AdmissionInfo: userRequestInfo, + Context: ctx, } for _, policy := range policies {