Skip to content

Commit

Permalink
Copy static variable 'verb' before instrumenting APIserver call to pr…
Browse files Browse the repository at this point in the history
…event overwriting
  • Loading branch information
shyamjvs committed May 18, 2017
1 parent 17b22cb commit 4d457f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ func InstrumentRouteFunc(verb, resource string, routeFunc restful.RouteFunction)

routeFunc(request, response)

reportedVerb := verb
if verb == "LIST" && strings.ToLower(request.QueryParameter("watch")) == "true" {
verb = "WATCH"
reportedVerb = "WATCH"
}
Monitor(&verb, &resource, cleanUserAgent(utilnet.GetHTTPClient(request.Request)), rw.Header().Get("Content-Type"), delegate.status, now)
Monitor(&reportedVerb, &resource, cleanUserAgent(utilnet.GetHTTPClient(request.Request)), rw.Header().Get("Content-Type"), delegate.status, now)
})
}

Expand Down

0 comments on commit 4d457f5

Please sign in to comment.