mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Do not automatically decode runtime.RawExtension
Make clients opt in to decoding objects that are stored in the generic api.List object by invoking runtime.DecodeList() with a set of schemes. Makes it easier to handle unknown schema objects because decoding is in the control of the code. Add runtime.Unstructured, which is a simple in memory representation of an external object.
This commit is contained in:
@@ -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