mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Update client library to react to changes in Decoding
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user