@@ -144,7 +144,7 @@ func (r *CircuitBreakerReconciler) Reconcile(ctx context.Context, req ctrl.Reque
144
144
defaultPodConfigCache .Delete (po .Namespace , po .Name )
145
145
continue
146
146
}
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 {
148
148
reconcileErr = errors .Join (reconcileErr , err )
149
149
klog .Errorf ("failed to delete config in pod %s, %v" , st .PodName , err )
150
150
failedStatus = append (failedStatus , cb .Status .TargetStatus [i ])
@@ -187,21 +187,6 @@ func (r *CircuitBreakerReconciler) syncPodConfig(ctx context.Context, cb *proto.
187
187
return resp .Msg .LimitingSnapshot , nil
188
188
}
189
189
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
-
205
190
func (r * CircuitBreakerReconciler ) currentPodStatus (cb * ctrlmeshv1alpha1.CircuitBreaker , podName string ) * ctrlmeshv1alpha1.TargetStatus {
206
191
for i , state := range cb .Status .TargetStatus {
207
192
if state .PodName == podName {
@@ -269,7 +254,7 @@ func (r *CircuitBreakerReconciler) clear(ctx context.Context, cb *ctrlmeshv1alph
269
254
continue
270
255
}
271
256
272
- if localErr := r . disableConfig (ctx , state .PodIP , cb .Name ); localErr != nil {
257
+ if localErr := disableConfig (ctx , state .PodIP , cb .Name ); localErr != nil {
273
258
err = errors .Join (err , localErr )
274
259
} else {
275
260
defaultPodConfigCache .Delete (cb .Namespace , state .PodName , cb .Name )
@@ -278,7 +263,7 @@ func (r *CircuitBreakerReconciler) clear(ctx context.Context, cb *ctrlmeshv1alph
278
263
return err
279
264
}
280
265
281
- func ( r * CircuitBreakerReconciler ) disableConfig (ctx context.Context , podIp string , name string ) error {
266
+ func disableConfig (ctx context.Context , podIp string , name string ) error {
282
267
req := & proto.CircuitBreaker {
283
268
Option : proto .CircuitBreaker_DELETE ,
284
269
Name : name ,
0 commit comments