diff --git a/hub/kv.go b/hub/kv.go index e2b363be4..9fbdcaf00 100644 --- a/hub/kv.go +++ b/hub/kv.go @@ -37,6 +37,10 @@ type KVMap struct { var _ KV = &KVMap{} +func NewKVMap(cache map[string]*v1alpha1.ResourceDescriptor) KV { + return &KVMap{cache: cache} +} + func (s *KVMap) Set(key string, val *v1alpha1.ResourceDescriptor) { s.m.Lock() s.cache[key] = val