mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
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 ```
This commit is contained in:
commit
3e8faa22b0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user