Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit c1af9dc

Browse files
author
k8s-merge-robot
committed
Merge pull request kubernetes#17885 from hongchaodeng/register
Auto commit by PR queue bot
2 parents 585a876 + 0521481 commit c1af9dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/client/unversioned/request.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ import (
4848
// are therefore not allowed to set manually.
4949
var specialParams = sets.NewString("timeout")
5050

51+
func init() {
52+
metrics.Register()
53+
}
54+
5155
// HTTPClient is an interface for testing a request object.
5256
type HTTPClient interface {
5357
Do(req *http.Request) (*http.Response, error)
@@ -109,7 +113,6 @@ type Request struct {
109113
// NewRequest creates a new request helper object for accessing runtime.Objects on a server.
110114
func NewRequest(client HTTPClient, verb string, baseURL *url.URL, apiVersion string,
111115
codec runtime.Codec) *Request {
112-
metrics.Register()
113116
return &Request{
114117
client: client,
115118
verb: verb,

0 commit comments

Comments
 (0)