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

744 relocating logic

This commit is contained in:
shravan 2020-05-07 23:11:04 +05:30
parent 717e42dd0b
commit 43d412039c
2 changed files with 4 additions and 9 deletions

View file

@ -355,15 +355,6 @@ func (ws *WebhookServer) resourceValidation(request *v1beta1.AdmissionRequest) *
logger.Error(err, "failed to load service account in context")
}
if val, err := ctx.Query("request.object.metadata.deletionTimestamp"); val != nil && err == nil {
return &v1beta1.AdmissionResponse{
Allowed: true,
Result: &metav1.Status{
Status: "Success",
},
}
}
// VALIDATION
ok, msg := ws.HandleValidation(request, policies, nil, ctx, userRequestInfo)
if !ok {

View file

@ -23,6 +23,10 @@ func (ws *WebhookServer) HandleValidation(request *v1beta1.AdmissionRequest, pol
logger := ws.log.WithValues("action", "validation", "uid", request.UID, "kind", request.Kind, "namespace", request.Namespace, "name", request.Name, "operation", request.Operation)
logger.V(4).Info("incoming request")
if val, err := ctx.Query("request.object.metadata.deletionTimestamp"); val != nil && err == nil {
return true, ""
}
// Get new and old resource
newR, oldR, err := utils.ExtractResources(patchedResource, request)
if err != nil {