mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
fix e2e failure
This commit is contained in:
parent
c4822dc060
commit
1fdf749211
@ -322,14 +322,13 @@ func (s *Scheme) Convert(in, out interface{}) error {
|
|||||||
// Converts the given field label and value for an apiResource field selector from
|
// Converts the given field label and value for an apiResource field selector from
|
||||||
// versioned representation to an unversioned one.
|
// versioned representation to an unversioned one.
|
||||||
func (s *Scheme) ConvertFieldLabel(version, apiResource, label, value string) (string, string, error) {
|
func (s *Scheme) ConvertFieldLabel(version, apiResource, label, value string) (string, string, error) {
|
||||||
if s.fieldLabelConversionFuncs[version] == nil {
|
if typeFuncMap, ok := s.fieldLabelConversionFuncs[version]; ok {
|
||||||
return "", "", fmt.Errorf("No conversion function found for version: %s", version)
|
if conversionFunc, ok := typeFuncMap[apiResource]; ok {
|
||||||
|
return conversionFunc(label, value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
conversionFunc, ok := s.fieldLabelConversionFuncs[version][apiResource]
|
// Don't fail on types we haven't added conversion funcs for yet.
|
||||||
if !ok {
|
return label, value, nil
|
||||||
return "", "", fmt.Errorf("No conversion function found for version %s and api resource %s", version, apiResource)
|
|
||||||
}
|
|
||||||
return conversionFunc(label, value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConvertToVersion attempts to convert an input object to its matching Kind in another
|
// ConvertToVersion attempts to convert an input object to its matching Kind in another
|
||||||
|
Loading…
Reference in New Issue
Block a user