diff --git a/pkg/webhooks/mutation.go b/pkg/webhooks/mutation.go index 7df5f9a8c8..1d99b77ba2 100644 --- a/pkg/webhooks/mutation.go +++ b/pkg/webhooks/mutation.go @@ -24,7 +24,11 @@ func (ws *WebhookServer) HandleMutation(request *v1beta1.AdmissionRequest) *v1be } rname := engine.ParseNameFromObject(request.Object.Raw) rns := engine.ParseNamespaceFromObject(request.Object.Raw) - rkind := engine.ParseKindFromObject(request.Object.Raw) + rkind := request.Kind.Kind + if rkind == "" { + //TODO TEST: just to check if we actually recieve a api-request that is blank ? + glog.Error(request) + } var allPatches [][]byte var annPatches []byte diff --git a/pkg/webhooks/validation.go b/pkg/webhooks/validation.go index 5c90c92c12..fd1bdc41a7 100644 --- a/pkg/webhooks/validation.go +++ b/pkg/webhooks/validation.go @@ -26,7 +26,11 @@ func (ws *WebhookServer) HandleValidation(request *v1beta1.AdmissionRequest) *v1 rname := engine.ParseNameFromObject(request.Object.Raw) rns := engine.ParseNamespaceFromObject(request.Object.Raw) - rkind := engine.ParseKindFromObject(request.Object.Raw) + rkind := request.Kind.Kind + if rkind == "" { + //TODO TEST: just to check if we actually recieve a api-request that is blank ? + glog.Error(request) + } var annPatches []byte for _, policy := range policies {