744 relocating userRequestInfo to top level variable
@@ -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
