File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import (
20
20
"encoding/json"
21
21
"fmt"
22
22
"net/url"
23
+ "os"
24
+ "path/filepath"
23
25
24
26
"k8s.io/kubernetes/pkg/api"
25
27
"k8s.io/kubernetes/pkg/api/unversioned"
@@ -30,6 +32,7 @@ import (
30
32
31
33
"k8s.io/heapster/common/kubernetes"
32
34
"k8s.io/node-problem-detector/cmd/options"
35
+ "k8s.io/node-problem-detector/pkg/version"
33
36
)
34
37
35
38
// Client is the interface of problem client
@@ -62,6 +65,7 @@ func NewClientOrDie(npdo *options.NodeProblemDetectorOptions) Client {
62
65
panic (err )
63
66
}
64
67
68
+ cfg .UserAgent = fmt .Sprintf ("%s/%s" , filepath .Base (os .Args [0 ]), version .Version ())
65
69
// TODO(random-liu): Set QPS Limit
66
70
c .client = client .NewOrDie (cfg )
67
71
c .nodeName = npdo .NodeName
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import "fmt"
18
18
// version defines node-problem-detector version string.
19
19
var version string = "UNKNOWN"
20
20
21
+ func Version () string {
22
+ return version
23
+ }
24
+
21
25
func PrintVersion () {
22
26
fmt .Println (version )
23
27
}
You can’t perform that action at this time.
0 commit comments