Skip to content

Commit

Permalink
Merge pull request #53090 from shyamjvs/fix-traces
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Modify traces in deletion handler

Ref kubernetes/kubernetes#51899 (comment)

cc @kubernetes/sig-release-members @jdumars @dims Can we get this into 1.8?

Kubernetes-commit: 5952e932e9a1b593876c1504df5d1cb3fd72299d
  • Loading branch information
k8s-publish-robot committed Oct 16, 2017
2 parents ded52ff + 649cc4c commit 84fd207
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/endpoints/handlers/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,10 +987,11 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope RequestSco
scope.err(fmt.Errorf("decoded object cannot be converted to DeleteOptions"), w, req)
return
}
trace.Step("Decoded delete options")

trace.Step("About to record audit event")
ae := request.AuditEventFrom(ctx)
audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer)
trace.Step("Recorded the audit event")
} else {
if values := req.URL.Query(); len(values) > 0 {
if err := metainternalversion.ParameterCodec.DecodeParameters(values, scope.MetaGroupVersion, options); err != nil {
Expand All @@ -1002,8 +1003,8 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope RequestSco
}
}

trace.Step("About to check admission control")
if admit != nil && admit.Handles(admission.Delete) {
trace.Step("About to check admission control")
userInfo, _ := request.UserFrom(ctx)

err = admit.Admit(admission.NewAttributesRecord(nil, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Delete, userInfo))
Expand Down

0 comments on commit 84fd207

Please sign in to comment.