Fix metrics reporting in kube-apiserver

This commit is contained in:
wojtekt
2020-10-14 17:34:33 +02:00
parent b2de4a6159
commit 3d2a80643a
4 changed files with 136 additions and 0 deletions

View File

@@ -594,6 +594,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
requestScope = "resource"
operationSuffix = operationSuffix + "WithPath"
}
if strings.Index(action.Path, "/{name}") != -1 || action.Verb == "POST" {
requestScope = "resource"
}
if action.AllNamespaces {
requestScope = "cluster"
operationSuffix = operationSuffix + "ForAllNamespaces"