@@ -51,19 +51,19 @@ func (d *Deployment) listenForPodEvents(stopCh <-chan struct{}) {
5151 & v1.Pod {},
5252 cache.ResourceEventHandlerFuncs {
5353 AddFunc : func (obj interface {}) {
54- d .currentState .GetThrottles ().Pod ().Invalidate ()
54+ d .acs . CurrentClusterCache () .GetThrottles ().Pod ().Invalidate ()
5555 if p , ok := getPod (obj ); ok && d .isOwnerOf (p ) {
5656 d .triggerInspection ()
5757 }
5858 },
5959 UpdateFunc : func (oldObj , newObj interface {}) {
60- d .currentState .GetThrottles ().Pod ().Invalidate ()
60+ d .acs . CurrentClusterCache () .GetThrottles ().Pod ().Invalidate ()
6161 if p , ok := getPod (newObj ); ok && d .isOwnerOf (p ) {
6262 d .triggerInspection ()
6363 }
6464 },
6565 DeleteFunc : func (obj interface {}) {
66- d .currentState .GetThrottles ().Pod ().Invalidate ()
66+ d .acs . CurrentClusterCache () .GetThrottles ().Pod ().Invalidate ()
6767 if p , ok := getPod (obj ); ok && d .isOwnerOf (p ) {
6868 d .triggerInspection ()
6969 }
@@ -96,19 +96,19 @@ func (d *Deployment) listenForPVCEvents(stopCh <-chan struct{}) {
9696 & v1.PersistentVolumeClaim {},
9797 cache.ResourceEventHandlerFuncs {
9898 AddFunc : func (obj interface {}) {
99- d .currentState .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
99+ d .acs . CurrentClusterCache () .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
100100 if p , ok := getPVC (obj ); ok && d .isOwnerOf (p ) {
101101 d .triggerInspection ()
102102 }
103103 },
104104 UpdateFunc : func (oldObj , newObj interface {}) {
105- d .currentState .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
105+ d .acs . CurrentClusterCache () .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
106106 if p , ok := getPVC (newObj ); ok && d .isOwnerOf (p ) {
107107 d .triggerInspection ()
108108 }
109109 },
110110 DeleteFunc : func (obj interface {}) {
111- d .currentState .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
111+ d .acs . CurrentClusterCache () .GetThrottles ().PersistentVolumeClaim ().Invalidate ()
112112 if p , ok := getPVC (obj ); ok && d .isOwnerOf (p ) {
113113 d .triggerInspection ()
114114 }
@@ -142,19 +142,19 @@ func (d *Deployment) listenForSecretEvents(stopCh <-chan struct{}) {
142142 cache.ResourceEventHandlerFuncs {
143143 // Note: For secrets we look at all of them because they do not have to be owned by this deployment.
144144 AddFunc : func (obj interface {}) {
145- d .currentState .GetThrottles ().Secret ().Invalidate ()
145+ d .acs . CurrentClusterCache () .GetThrottles ().Secret ().Invalidate ()
146146 if getSecret (obj ) {
147147 d .triggerInspection ()
148148 }
149149 },
150150 UpdateFunc : func (oldObj , newObj interface {}) {
151- d .currentState .GetThrottles ().Secret ().Invalidate ()
151+ d .acs . CurrentClusterCache () .GetThrottles ().Secret ().Invalidate ()
152152 if getSecret (newObj ) {
153153 d .triggerInspection ()
154154 }
155155 },
156156 DeleteFunc : func (obj interface {}) {
157- d .currentState .GetThrottles ().Secret ().Invalidate ()
157+ d .acs . CurrentClusterCache () .GetThrottles ().Secret ().Invalidate ()
158158 if getSecret (obj ) {
159159 d .triggerInspection ()
160160 }
@@ -187,19 +187,19 @@ func (d *Deployment) listenForServiceEvents(stopCh <-chan struct{}) {
187187 & v1.Service {},
188188 cache.ResourceEventHandlerFuncs {
189189 AddFunc : func (obj interface {}) {
190- d .currentState .GetThrottles ().Service ().Invalidate ()
190+ d .acs . CurrentClusterCache () .GetThrottles ().Service ().Invalidate ()
191191 if s , ok := getService (obj ); ok && d .isOwnerOf (s ) {
192192 d .triggerInspection ()
193193 }
194194 },
195195 UpdateFunc : func (oldObj , newObj interface {}) {
196- d .currentState .GetThrottles ().Service ().Invalidate ()
196+ d .acs . CurrentClusterCache () .GetThrottles ().Service ().Invalidate ()
197197 if s , ok := getService (newObj ); ok && d .isOwnerOf (s ) {
198198 d .triggerInspection ()
199199 }
200200 },
201201 DeleteFunc : func (obj interface {}) {
202- d .currentState .GetThrottles ().Service ().Invalidate ()
202+ d .acs . CurrentClusterCache () .GetThrottles ().Service ().Invalidate ()
203203 if s , ok := getService (obj ); ok && d .isOwnerOf (s ) {
204204 d .triggerInspection ()
205205 }
0 commit comments