From fc84eaaf3b7f543eac17572390cbe0c4f9813b26 Mon Sep 17 00:00:00 2001 From: shravan Date: Wed, 29 Apr 2020 21:02:21 +0530 Subject: [PATCH] 744 relocating userRequestInfo to top level variable --- pkg/engine/context/context.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/engine/context/context.go b/pkg/engine/context/context.go index eba01a1538..f8d8aceabb 100644 --- a/pkg/engine/context/context.go +++ b/pkg/engine/context/context.go @@ -111,13 +111,7 @@ func (ctx *Context) AddResource(dataRaw []byte) error { //AddUserInfo adds userInfo at path request.userInfo func (ctx *Context) AddUserInfo(userRequestInfo kyverno.RequestInfo) error { - modifiedResource := struct { - Request interface{} `json:"request"` - }{ - Request: userRequestInfo, - } - - objRaw, err := json.Marshal(modifiedResource) + objRaw, err := json.Marshal(userRequestInfo) if err != nil { ctx.log.Error(err, "failed to marshal the UserInfo") return err