Update client library to react to changes in Decoding

This commit is contained in:
Clayton Coleman
2015-12-21 00:32:52 -05:00
parent 24a7919002
commit efe88e0818
20 changed files with 65 additions and 88 deletions

View File

@@ -128,7 +128,7 @@ type objects struct {
types map[string][]runtime.Object
last map[string]int
scheme ObjectScheme
decoder runtime.ObjectDecoder
decoder runtime.Decoder
}
var _ ObjectRetriever = &objects{}
@@ -143,7 +143,7 @@ var _ ObjectRetriever = &objects{}
// as a runtime.Object if Status == Success). If multiple PodLists are provided, they
// will be returned in order by the Kind call, and the last PodList will be reused for
// subsequent calls.
func NewObjects(scheme ObjectScheme, decoder runtime.ObjectDecoder) ObjectRetriever {
func NewObjects(scheme ObjectScheme, decoder runtime.Decoder) ObjectRetriever {
return objects{
types: make(map[string][]runtime.Object),
last: make(map[string]int),

View File

@@ -30,7 +30,7 @@ import (
// Clientset returns a clientset that will respond with the provided objects
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjects(api.Scheme, api.Scheme)
o := core.NewObjects(api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)