build: go 1.24
We were running behind and there were quite some deprecations to update. This was mostly in the upstream copy/pasta package but seems quite minimal.
This commit is contained in:
29
vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
generated
vendored
29
vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
generated
vendored
@ -54,9 +54,18 @@ func init() {
|
||||
balancer.Register(pickfirstBuilder{})
|
||||
}
|
||||
|
||||
// enableHealthListenerKeyType is a unique key type used in resolver attributes
|
||||
// to indicate whether the health listener usage is enabled.
|
||||
type enableHealthListenerKeyType struct{}
|
||||
type (
|
||||
// enableHealthListenerKeyType is a unique key type used in resolver
|
||||
// attributes to indicate whether the health listener usage is enabled.
|
||||
enableHealthListenerKeyType struct{}
|
||||
// managedByPickfirstKeyType is an attribute key type to inform Outlier
|
||||
// Detection that the generic health listener is being used.
|
||||
// TODO: https://github.com/grpc/grpc-go/issues/7915 - Remove this when
|
||||
// implementing the dualstack design. This is a hack. Once Dualstack is
|
||||
// completed, outlier detection will stop sending ejection updates through
|
||||
// the connectivity listener.
|
||||
managedByPickfirstKeyType struct{}
|
||||
)
|
||||
|
||||
var (
|
||||
logger = grpclog.Component("pick-first-leaf-lb")
|
||||
@ -111,7 +120,7 @@ func (pickfirstBuilder) Build(cc balancer.ClientConn, bo balancer.BuildOptions)
|
||||
b := &pickfirstBalancer{
|
||||
cc: cc,
|
||||
target: bo.Target.String(),
|
||||
metricsRecorder: bo.MetricsRecorder, // ClientConn will always create a Metrics Recorder.
|
||||
metricsRecorder: cc.MetricsRecorder(),
|
||||
|
||||
subConns: resolver.NewAddressMap(),
|
||||
state: connectivity.Connecting,
|
||||
@ -140,6 +149,17 @@ func EnableHealthListener(state resolver.State) resolver.State {
|
||||
return state
|
||||
}
|
||||
|
||||
// IsManagedByPickfirst returns whether an address belongs to a SubConn
|
||||
// managed by the pickfirst LB policy.
|
||||
// TODO: https://github.com/grpc/grpc-go/issues/7915 - This is a hack to disable
|
||||
// outlier_detection via the with connectivity listener when using pick_first.
|
||||
// Once Dualstack changes are complete, all SubConns will be created by
|
||||
// pick_first and outlier detection will only use the health listener for
|
||||
// ejection. This hack can then be removed.
|
||||
func IsManagedByPickfirst(addr resolver.Address) bool {
|
||||
return addr.BalancerAttributes.Value(managedByPickfirstKeyType{}) != nil
|
||||
}
|
||||
|
||||
type pfConfig struct {
|
||||
serviceconfig.LoadBalancingConfig `json:"-"`
|
||||
|
||||
@ -166,6 +186,7 @@ type scData struct {
|
||||
}
|
||||
|
||||
func (b *pickfirstBalancer) newSCData(addr resolver.Address) (*scData, error) {
|
||||
addr.BalancerAttributes = addr.BalancerAttributes.WithValue(managedByPickfirstKeyType{}, true)
|
||||
sd := &scData{
|
||||
rawConnectivityState: connectivity.Idle,
|
||||
effectiveState: connectivity.Idle,
|
||||
|
Reference in New Issue
Block a user