@@ -144,7 +144,7 @@ func (r *CircuitBreakerReconciler) Reconcile(ctx context.Context, req ctrl.Reque
144144 defaultPodConfigCache .Delete (po .Namespace , po .Name )
145145 continue
146146 }
147- if err := deletePodConfig (ctx , & proto. CircuitBreaker { Name : cb .Name }, st . PodIP ); err != nil {
147+ if err := disableConfig (ctx , st . PodIP , cb .Name ); err != nil {
148148 reconcileErr = errors .Join (reconcileErr , err )
149149 klog .Errorf ("failed to delete config in pod %s, %v" , st .PodName , err )
150150 failedStatus = append (failedStatus , cb .Status .TargetStatus [i ])
@@ -187,21 +187,6 @@ func (r *CircuitBreakerReconciler) syncPodConfig(ctx context.Context, cb *proto.
187187 return resp .Msg .LimitingSnapshot , nil
188188}
189189
190- func deletePodConfig (ctx context.Context , cb * proto.CircuitBreaker , podIp string ) error {
191- cb .Option = proto .CircuitBreaker_DELETE
192- resp , err := protoClient (podIp ).SendConfig (ctx , connect .NewRequest (cb ))
193- if err != nil {
194- return err
195- }
196- if resp .Msg == nil {
197- return fmt .Errorf ("fail to update pod [%s, %s] circuit breaker config, server return nil response" , podIp , cb .Name )
198- }
199- if resp != nil && ! resp .Msg .Success {
200- return fmt .Errorf ("fail to update pod [%s, %s] circuit breaker config, %s" , podIp , cb .Name , resp .Msg .Message )
201- }
202- return nil
203- }
204-
205190func (r * CircuitBreakerReconciler ) currentPodStatus (cb * ctrlmeshv1alpha1.CircuitBreaker , podName string ) * ctrlmeshv1alpha1.TargetStatus {
206191 for i , state := range cb .Status .TargetStatus {
207192 if state .PodName == podName {
@@ -269,7 +254,7 @@ func (r *CircuitBreakerReconciler) clear(ctx context.Context, cb *ctrlmeshv1alph
269254 continue
270255 }
271256
272- if localErr := r . disableConfig (ctx , state .PodIP , cb .Name ); localErr != nil {
257+ if localErr := disableConfig (ctx , state .PodIP , cb .Name ); localErr != nil {
273258 err = errors .Join (err , localErr )
274259 } else {
275260 defaultPodConfigCache .Delete (cb .Namespace , state .PodName , cb .Name )
@@ -278,7 +263,7 @@ func (r *CircuitBreakerReconciler) clear(ctx context.Context, cb *ctrlmeshv1alph
278263 return err
279264}
280265
281- func ( r * CircuitBreakerReconciler ) disableConfig (ctx context.Context , podIp string , name string ) error {
266+ func disableConfig (ctx context.Context , podIp string , name string ) error {
282267 req := & proto.CircuitBreaker {
283268 Option : proto .CircuitBreaker_DELETE ,
284269 Name : name ,
0 commit comments