mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Add metrics to monitor the kubelet http server
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
This commit is contained in:
@@ -1666,3 +1666,24 @@ func TestDebuggingDisabledHandlers(t *testing.T) {
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
|
||||
}
|
||||
|
||||
func TestTrimURLPath(t *testing.T) {
|
||||
tests := []struct {
|
||||
path, expected string
|
||||
}{
|
||||
{"", ""},
|
||||
{"//", ""},
|
||||
{"/pods", "pods"},
|
||||
{"pods", "pods"},
|
||||
{"pods/", "pods"},
|
||||
{"good/", "good"},
|
||||
{"pods/probes", "pods"},
|
||||
{"metrics", "metrics"},
|
||||
{"metrics/resource", "metrics/resource"},
|
||||
{"metrics/hello", "metrics/hello"},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
assert.Equal(t, test.expected, trimURLPath(test.path), fmt.Sprintf("path is: %s", test.path))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user