1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

744 relocating userRequestInfo to top level variable

This commit is contained in:
shravan 2020-04-29 21:02:21 +05:30
parent f8f27cea18
commit fc84eaaf3b

View file

@ -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