Unverified Commit 3e8faa22 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65518 from hzxuzhonghu/api-verbs

Automatic merge from submit-queue (batch tested with PRs 65518, 65624, 65380, 65390, 65586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. transform ConnectMethods to kube verbs **What this PR does / why we need it**: /api/v1 does not list any verb for "pods/attach" and "pods/exec", this pr transform the ConnectMethods to kube verbs. Fixes #65421 **Special notes for your reviewer**: before this: ``` { "name": "nodes/proxy", "verbs": [] }, { "name": "pods/attach", "verbs": [] }, { "name": "pods/exec", "verbs": [] }, { "name": "pods/portforward", "verbs": [] }, { "name": "pods/proxy", "verbs": [] }, { "name": "services/proxy", "verbs": [] }, ``` after this: ``` { "name": "nodes/proxy", "verbs": [ "create", "delete", "get", "patch", "update" ] }, { "name": "pods/attach", "verbs": [ "create", "get" ] }, { "name": "pods/exec", "verbs": [ "create", "get" ] }, { "name": "pods/portforward", "verbs": [ "create", "get" ] }, { "name": "pods/proxy", "verbs": [ "create", "delete", "get", "patch", "update" ] }, { "name": "services/proxy", "verbs": [ "create", "delete", "get", "patch", "update" ] }, ``` /assign @liggitt **Release note**: ```release-note NONE ```
parents 4f465fac 8c820ae3
......@@ -805,6 +805,13 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
}
addParams(route, action.Params)
routes = append(routes, route)
// transform ConnectMethods to kube verbs
if kubeVerb, found := toDiscoveryKubeVerb[method]; found {
if len(kubeVerb) != 0 {
kubeVerbs[kubeVerb] = struct{}{}
}
}
}
default:
return nil, fmt.Errorf("unrecognized action verb: %s", action.Verb)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment