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 13, 2017
2 parents 98b134d + fcc5647 commit eb5aae4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 60 deletions.
116 changes: 58 additions & 58 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 eb5aae4

Please sign in to comment.