Merge pull request #119321 from mingregister/mingregister-patch-1

replace strings.Index  with strings.Contains

Kubernetes-commit: b2a9c06b2e7419691de5ea4f7d112baa2e00bc29
This commit is contained in:
Kubernetes Publisher 2023-07-17 20:55:18 -07:00
commit 149a4e6556
1 changed files with 1 additions and 1 deletions

View File

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