You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"GET long prefix": {"GET", "/"+prefix+"/", http.StatusNotFound, 0},
258
310
259
-
"root GET missing storage": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/blah", http.StatusNotFound, 0},
260
-
261
-
"namespaced GET long prefix": {"GET", "/"+prefix+"/", http.StatusNotFound, 0},
262
-
"namespaced GET missing storage": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/blah", http.StatusNotFound, 0},
311
+
"root GET missing storage": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/blah", http.StatusNotFound, 0},
263
312
264
-
"GET at root resource leaf": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/nodes/foo", http.StatusNotFound, 0},
265
-
"GET at namespaced resource leaft": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/namespaces/ns/pods/bar", http.StatusNotFound, 0},
313
+
"GET at root resource leaf": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/nodes/foo", http.StatusNotFound, 0},
314
+
"GET at namespaced resource leaft": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/namespaces/ns/pods/bar", http.StatusNotFound, 0},
266
315
267
316
// Positive checks to make sure everything is wired correctly
268
-
"GET for all nodes (root)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/nodes/*/some-metric", http.StatusOK, totalNodesCount},
269
-
"GET for all pods (namespaced)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/namespaces/ns/pods/*/some-metric", http.StatusOK, totalPodsCount},
270
-
"GET for namespace": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/namespaces/ns/metrics/some-metric", http.StatusOK, 1},
271
-
"GET for label selected nodes (root)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/nodes/*/some-metric?labelSelector=foo%3Dbar", http.StatusOK, matchingNodesCount},
272
-
"GET for label selected pods (namespaced)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/namespaces/ns/pods/*/some-metric?labelSelector=foo%3Dbar", http.StatusOK, matchingPodsCount},
273
-
"GET for single node (root)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/nodes/foo/some-metric", http.StatusOK, 1},
274
-
"GET for single pod (namespaced)": {"GET", "/"+prefix+"/"+groupVersion.Group+"/"+groupVersion.Version+"/namespaces/ns/pods/foo/some-metric", http.StatusOK, 1},
317
+
"GET for all nodes (root)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/nodes/*/some-metric", http.StatusOK, totalNodesCount},
318
+
"GET for all pods (namespaced)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/namespaces/ns/pods/*/some-metric", http.StatusOK, totalPodsCount},
319
+
"GET for namespace": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/namespaces/ns/metrics/some-metric", http.StatusOK, 1},
320
+
"GET for label selected nodes (root)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/nodes/*/some-metric?labelSelector=foo%3Dbar", http.StatusOK, matchingNodesCount},
321
+
"GET for label selected pods (namespaced)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/namespaces/ns/pods/*/some-metric?labelSelector=foo%3Dbar", http.StatusOK, matchingPodsCount},
322
+
"GET for single node (root)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/nodes/foo/some-metric", http.StatusOK, 1},
323
+
"GET for single pod (namespaced)": {"GET", "/"+prefix+"/"+customMetricsGroupVersion.Group+"/"+customMetricsGroupVersion.Version+"/namespaces/ns/pods/foo/some-metric", http.StatusOK, 1},
"GET long prefix": {"GET", "/"+prefix+"/", http.StatusNotFound, 0},
373
+
"GET at root scope": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/nonexistent-metric", http.StatusNotFound, 0},
374
+
"GET without metric name": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/namespaces/foo", http.StatusNotFound, 0},
375
+
"GET for metric with slashes": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/namespaces/foo/group/metric", http.StatusNotFound, 0},
376
+
377
+
// Positive checks to make sure everything is wired correctly
378
+
"GET for external metric": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/namespaces/default/my-external-metric", http.StatusOK, 2},
379
+
"GET for external metric with selector": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/namespaces/default/my-external-metric?labelSelector=foo%3Dbar", http.StatusOK, 1},
380
+
"GET for nonexistent metric": {"GET", "/"+prefix+"/"+externalMetricsGroupVersion.Group+"/"+externalMetricsGroupVersion.Version+"/namespaces/foo/nonexistent-metric", http.StatusOK, 0},
381
+
}
320
382
383
+
// "real" fake provider implementation can be used in test, because it doesn't have any dependencies.
384
+
// Note: this provider has a hardcoded list of external metrics.
0 commit comments