mirror of https://github.com/k3s-io/k3s
parent
5c780c8cb1
commit
4c42d542dc
|
@ -226,7 +226,6 @@ pkg/kubelet/status/testing
|
|||
pkg/kubelet/sysctl
|
||||
pkg/kubelet/types
|
||||
pkg/kubelet/util
|
||||
pkg/kubelet/util/cache
|
||||
pkg/kubelet/util/pluginwatcher
|
||||
pkg/kubelet/util/queue
|
||||
pkg/kubelet/util/sliceutils
|
||||
|
|
|
@ -75,6 +75,7 @@ func (c *ObjectCache) Get(key string) (interface{}, error) {
|
|||
return value.(objectEntry).obj, nil
|
||||
}
|
||||
|
||||
// Add adds objectEntry by using a unique string as the key.
|
||||
func (c *ObjectCache) Add(key string, obj interface{}) error {
|
||||
err := c.cache.Add(objectEntry{key: key, obj: obj})
|
||||
if err != nil {
|
||||
|
|
|
@ -46,7 +46,7 @@ func TestAddAndGet(t *testing.T) {
|
|||
val: "bar",
|
||||
}
|
||||
objectCache := NewFakeObjectCache(func() (interface{}, error) {
|
||||
return nil, fmt.Errorf("Unexpected Error: updater should never be called in this test!")
|
||||
return nil, fmt.Errorf("Unexpected Error: updater should never be called in this test")
|
||||
}, 1*time.Hour, clock.NewFakeClock(time.Now()))
|
||||
|
||||
err := objectCache.Add(testObj.key, testObj.val)
|
||||
|
|
Loading…
Reference in New Issue