github.com/kiali/kiali@v1.84.0/kubernetes/cache/registry_status.go (about) 1 package cache 2 3 import ( 4 "github.com/kiali/kiali/kubernetes" 5 "github.com/kiali/kiali/log" 6 ) 7 8 type ( 9 RegistryStatusCache interface { 10 GetRegistryStatus(cluster string) *kubernetes.RegistryStatus 11 SetRegistryStatus(registryStatus map[string]*kubernetes.RegistryStatus) 12 } 13 ) 14 15 func (c *kialiCacheImpl) GetRegistryStatus(cluster string) *kubernetes.RegistryStatus { 16 status, found := c.registryStatusStore.Get(cluster) 17 if !found { 18 // Ignoring any errors here because registry services are optional. Most likely any errors 19 // here are due to cache misses since populating the cache is handled asynchronously. 20 log.Tracef("Unable to get registry status for cluster [%s]. Registry status not found in cache.", cluster) 21 return nil 22 } 23 24 return status 25 } 26 27 func (c *kialiCacheImpl) SetRegistryStatus(registryStatus map[string]*kubernetes.RegistryStatus) { 28 c.registryStatusStore.Replace(registryStatus) 29 }