mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Make OpenAPI GVK and Action extensions all lower-case
This commit is contained in:
parent
052cd6d30b
commit
a3cbfde4b1
@ -370,15 +370,15 @@ func (o *Resources) getGroupVersionKind(s spec.Schema) (schema.GroupVersionKind,
|
|||||||
if !ok {
|
if !ok {
|
||||||
return empty, fmt.Errorf("%s extension has unexpected type %T in %s", groupVersionKindExtensionKey, gvk, s.Extensions)
|
return empty, fmt.Errorf("%s extension has unexpected type %T in %s", groupVersionKindExtensionKey, gvk, s.Extensions)
|
||||||
}
|
}
|
||||||
group, ok := gvkMap["Group"].(string)
|
group, ok := gvkMap["group"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return empty, fmt.Errorf("%s extension missing Group: %v", groupVersionKindExtensionKey, gvkMap)
|
return empty, fmt.Errorf("%s extension missing Group: %v", groupVersionKindExtensionKey, gvkMap)
|
||||||
}
|
}
|
||||||
version, ok := gvkMap["Version"].(string)
|
version, ok := gvkMap["version"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return empty, fmt.Errorf("%s extension missing Version: %v", groupVersionKindExtensionKey, gvkMap)
|
return empty, fmt.Errorf("%s extension missing Version: %v", groupVersionKindExtensionKey, gvkMap)
|
||||||
}
|
}
|
||||||
kind, ok := gvkMap["Kind"].(string)
|
kind, ok := gvkMap["kind"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return empty, fmt.Errorf("%s extension missing Kind: %v", groupVersionKindExtensionKey, gvkMap)
|
return empty, fmt.Errorf("%s extension missing Kind: %v", groupVersionKindExtensionKey, gvkMap)
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ func (gk *GroupKind) String() string {
|
|||||||
//
|
//
|
||||||
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
||||||
type GroupVersionKind struct {
|
type GroupVersionKind struct {
|
||||||
Group string `protobuf:"bytes,1,opt,name=group"`
|
Group string `json:"group" protobuf:"bytes,1,opt,name=group"`
|
||||||
Version string `protobuf:"bytes,2,opt,name=version"`
|
Version string `json:"version" protobuf:"bytes,2,opt,name=version"`
|
||||||
Kind string `protobuf:"bytes,3,opt,name=kind"`
|
Kind string `json:"kind" protobuf:"bytes,3,opt,name=kind"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gvk GroupVersionKind) String() string {
|
func (gvk GroupVersionKind) String() string {
|
||||||
|
@ -800,8 +800,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
|
|||||||
return nil, fmt.Errorf("unrecognized action verb: %s", action.Verb)
|
return nil, fmt.Errorf("unrecognized action verb: %s", action.Verb)
|
||||||
}
|
}
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
route.Metadata(ROUTE_META_GVK, reqScope.Kind)
|
route.Metadata(ROUTE_META_GVK, metav1.GroupVersionKind{
|
||||||
route.Metadata(ROUTE_META_ACTION, action.Verb)
|
Group: reqScope.Kind.Group,
|
||||||
|
Version: reqScope.Kind.Version,
|
||||||
|
Kind: reqScope.Kind.Kind,
|
||||||
|
})
|
||||||
|
route.Metadata(ROUTE_META_ACTION, strings.ToLower(action.Verb))
|
||||||
ws.Route(route)
|
ws.Route(route)
|
||||||
}
|
}
|
||||||
// Note: update GetAuthorizerAttributes() when adding a custom handler.
|
// Note: update GetAuthorizerAttributes() when adding a custom handler.
|
||||||
|
Loading…
Reference in New Issue
Block a user