mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Merge pull request #7490 from smarterclayton/alter_list
Do not automatically decode runtime.RawExtension
This commit is contained in:
@@ -54,6 +54,10 @@ type missingKindErr struct {
|
||||
data string
|
||||
}
|
||||
|
||||
func NewMissingKindErr(data string) error {
|
||||
return &missingKindErr{data}
|
||||
}
|
||||
|
||||
func (k *missingKindErr) Error() string {
|
||||
return fmt.Sprintf("Object 'Kind' is missing in '%s'", k.data)
|
||||
}
|
||||
@@ -70,6 +74,10 @@ type missingVersionErr struct {
|
||||
data string
|
||||
}
|
||||
|
||||
func NewMissingVersionErr(data string) error {
|
||||
return &missingVersionErr{data}
|
||||
}
|
||||
|
||||
func (k *missingVersionErr) Error() string {
|
||||
return fmt.Sprintf("Object 'apiVersion' is missing in '%s'", k.data)
|
||||
}
|
||||
|
@@ -238,6 +238,17 @@ func (s *Scheme) AddDefaultingFuncs(defaultingFuncs ...interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Recognizes returns true if the scheme is able to handle the provided version and kind
|
||||
// of an object.
|
||||
func (s *Scheme) Recognizes(version, kind string) bool {
|
||||
m, ok := s.versionMap[version]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
_, ok = m[kind]
|
||||
return ok
|
||||
}
|
||||
|
||||
// RegisterInputDefaults sets the provided field mapping function and field matching
|
||||
// as the defaults for the provided input type. The fn may be nil, in which case no
|
||||
// mapping will happen by default. Use this method to register a mechanism for handling
|
||||
|
Reference in New Issue
Block a user