// watchConfigMaps monitors the kubernetes API for modifications and deletions of configmaps
// it evicts them from the internal cache
watchConfigMaps monitors the kubernetes API for modifications and deletions of configmaps
it evicts them from the internal cache
// watchConfigMaps monitors the kubernetes API for modifications and deletions of configmaps // it evicts them from the internal cache
func (rm *ResourceManager) watchConfigMaps() {
	var opts metav1.ListOptions
	w, err := rm.k8sClient.CoreV1().ConfigMaps(v1.NamespaceAll).Watch(opts)
	if err != nil {
		log.Fatal(err)
	}
	for {
		select {
		case ev, ok := <-w.ResultChan():
			if !ok {
				return
			}
			rm.Lock()
			configMapkey := rm.getStoreKey(ev.Object.(*v1.ConfigMap).Namespace, ev.Object.(*v1.ConfigMap).Name)
			switch ev.Type {
			case watch.Modified:
				delete(rm.configMaps, configMapkey)
			case watch.Deleted:
				delete(rm.configMaps, configMapkey)
			}
			rm.Unlock()
		}
	}
}
func ( rm * ResourceManager ) watchConfigMaps ( ) { var opts metav1 . ListOptions w , err := rm . k8sClient . CoreV1 ( ) . ConfigMaps ( v1 . NamespaceAll ) . Watch ( opts ) if err != nil { log . Fatal ( err ) } for { select { case ev , ok := <- w . ResultChan ( ) : if ! ok { return } rm . Lock ( ) configMapkey := rm . getStoreKey ( ev . Object . ( * v1 . ConfigMap ) . Namespace , ev . Object . ( * v1 . ConfigMap ) . Name ) switch ev . Type { case watch . Modified : delete ( rm . configMaps , configMapkey ) case watch . Deleted : delete ( rm . configMaps , configMapkey ) } rm . Unlock ( ) } } }
watchConfigMaps monitors the kubernetes API for modifications and deletions of configmaps
it evicts them from the internal cache
watchConfigMaps monitors the kubernetes API for modifications and deletions of configmaps it evicts them from the internal cache