@@ -342,7 +342,7 @@ func (b *cdsBalancer) ResolverError(err error) {
342
342
if b .lbCfg != nil {
343
343
root = b .lbCfg .ClusterName
344
344
}
345
- b .onClusterError (root , err )
345
+ b .onClusterAmbientError (root , err )
346
346
})
347
347
}
348
348
@@ -428,20 +428,20 @@ func (b *cdsBalancer) onClusterUpdate(name string, update xdsresource.ClusterUpd
428
428
// If the security config is invalid, for example, if the provider
429
429
// instance is not found in the bootstrap config, we need to put the
430
430
// channel in transient failure.
431
- b .onClusterError (name , fmt .Errorf ("received Cluster resource contains invalid security config: %v" , err ))
431
+ b .onClusterAmbientError (name , fmt .Errorf ("received Cluster resource contains invalid security config: %v" , err ))
432
432
return
433
433
}
434
434
}
435
435
436
436
clustersSeen := make (map [string ]bool )
437
437
dms , ok , err := b .generateDMsForCluster (b .lbCfg .ClusterName , 0 , nil , clustersSeen )
438
438
if err != nil {
439
- b .onClusterError (b .lbCfg .ClusterName , fmt .Errorf ("failed to generate discovery mechanisms: %v" , err ))
439
+ b .onClusterAmbientError (b .lbCfg .ClusterName , fmt .Errorf ("failed to generate discovery mechanisms: %v" , err ))
440
440
return
441
441
}
442
442
if ok {
443
443
if len (dms ) == 0 {
444
- b .onClusterError (b .lbCfg .ClusterName , fmt .Errorf ("aggregate cluster graph has no leaf clusters" ))
444
+ b .onClusterAmbientError (b .lbCfg .ClusterName , fmt .Errorf ("aggregate cluster graph has no leaf clusters" ))
445
445
return
446
446
}
447
447
// Child policy is built the first time we resolve the cluster graph.
@@ -501,7 +501,7 @@ func (b *cdsBalancer) onClusterUpdate(name string, update xdsresource.ClusterUpd
501
501
// TRANSIENT_FAILURE.
502
502
//
503
503
// Only executed in the context of a serializer callback.
504
- func (b * cdsBalancer ) onClusterError (name string , err error ) {
504
+ func (b * cdsBalancer ) onClusterAmbientError (name string , err error ) {
505
505
b .logger .Warningf ("Cluster resource %q received error update: %v" , name , err )
506
506
507
507
if b .childLB != nil {
@@ -525,15 +525,14 @@ func (b *cdsBalancer) onClusterError(name string, err error) {
525
525
// TRANSIENT_FAILURE.
526
526
//
527
527
// Only executed in the context of a serializer callback.
528
- func (b * cdsBalancer ) onClusterResourceNotFound (name string ) {
529
- err := xdsresource .NewErrorf (xdsresource .ErrorTypeResourceNotFound , "resource name %q of type Cluster not found in received response" , name )
528
+ func (b * cdsBalancer ) onClusterResourceChangedError (name string , err error ) {
530
529
if b .childLB != nil {
531
530
b .childLB .ResolverError (err )
532
531
} else {
533
532
// If child balancer was never created, fail the RPCs with errors.
534
533
b .ccw .UpdateState (balancer.State {
535
534
ConnectivityState : connectivity .TransientFailure ,
536
- Picker : base .NewErrPicker (err ),
535
+ Picker : base .NewErrPicker (fmt . Errorf ( "%q: %v" , name , err ) ),
537
536
})
538
537
}
539
538
}
0 commit comments