mirror of
https://github.com/niusmallnan/steve.git
synced 2025-08-30 20:05:20 +00:00
Use local scheme for parameter decoding
This commit is contained in:
parent
e81a4e2c6e
commit
9b7fcc9a01
@ -32,9 +32,15 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
lowerChars = regexp.MustCompile("[a-z]+")
|
||||
lowerChars = regexp.MustCompile("[a-z]+")
|
||||
paramScheme = runtime.NewScheme()
|
||||
paramCodec = runtime.NewParameterCodec(paramScheme)
|
||||
)
|
||||
|
||||
func init() {
|
||||
metav1.AddToGroupVersion(paramScheme, metav1.SchemeGroupVersion)
|
||||
}
|
||||
|
||||
type ClientGetter interface {
|
||||
IsImpersonating() bool
|
||||
K8sInterface(ctx *types.APIRequest) (kubernetes.Interface, error)
|
||||
@ -78,7 +84,7 @@ func (s *Store) ByID(apiOp *types.APIRequest, schema *types.APISchema, id string
|
||||
}
|
||||
|
||||
func decodeParams(apiOp *types.APIRequest, target runtime.Object) error {
|
||||
return metav1.ParameterCodec.DecodeParameters(apiOp.Request.URL.Query(), metav1.SchemeGroupVersion, target)
|
||||
return paramCodec.DecodeParameters(apiOp.Request.URL.Query(), metav1.SchemeGroupVersion, target)
|
||||
}
|
||||
|
||||
func toAPI(schema *types.APISchema, obj runtime.Object) types.APIObject {
|
||||
|
Loading…
Reference in New Issue
Block a user