mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-08 16:21:50 +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:
@@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
func TestNewClient(t *testing.T) {
|
||||
o := NewObjects(api.Scheme)
|
||||
if err := AddObjectsFromPath("../../../examples/guestbook/frontend-service.json", o); err != nil {
|
||||
o := NewObjects(api.Scheme, api.Scheme)
|
||||
if err := AddObjectsFromPath("../../../examples/guestbook/frontend-service.json", o, api.Scheme); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
client := &Fake{ReactFn: ObjectReaction(o, latest.RESTMapper)}
|
||||
@@ -52,7 +52,7 @@ func TestNewClient(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
o := NewObjects(api.Scheme)
|
||||
o := NewObjects(api.Scheme, api.Scheme)
|
||||
o.Add(&api.List{
|
||||
Items: []runtime.Object{
|
||||
// This first call to List will return this error
|
||||
|
||||
Reference in New Issue
Block a user