Skip to content

Commit

Permalink
fix result removal for DELETION requests (#1811)
Browse files Browse the repository at this point in the history
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
  • Loading branch information
realshuting committed Apr 16, 2021
1 parent a4b639f commit f93f334
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/webhooks/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ func HandleValidation(
return false, getEnforceFailureErrorMsg(engineResponses)
}

prInfos := policyreport.GeneratePRsFromEngineResponse(engineResponses, logger)
prGenerator.Add(prInfos...)

if request.Operation == v1beta1.Delete {
prGenerator.Add(buildDeletionPrInfo(oldR))
return true, ""
}

prInfos := policyreport.GeneratePRsFromEngineResponse(engineResponses, logger)
prGenerator.Add(prInfos...)

return true, ""
}

Expand Down

0 comments on commit f93f334

Please sign in to comment.