Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds/outlierdetection: fix config handling #6361

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions internal/balancer/nop/nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ import (
"google.golang.org/grpc/connectivity"
)

// Balancer is a balancer with all of its balancer operations as no-ops, other
// than returning a Transient Failure Picker on a Client Conn update.
type Balancer struct {
// bal is a balancer with all of its balancer operations as no-ops, other than
// returning a Transient Failure Picker on a Client Conn update.
type bal struct {
cc balancer.ClientConn
err error
}

// NewBalancer returns a no-op balancer.
func NewBalancer(cc balancer.ClientConn, err error) *Balancer {
return &Balancer{
func NewBalancer(cc balancer.ClientConn, err error) balancer.Balancer {
return &bal{
cc: cc,
err: err,
}
}

// UpdateClientConnState updates the Balancer's Client Conn with an Error Picker
// UpdateClientConnState updates the bal's Client Conn with an Error Picker
// and a Connectivity State of TRANSIENT_FAILURE.
func (b *Balancer) UpdateClientConnState(_ balancer.ClientConnState) error {
func (b *bal) UpdateClientConnState(_ balancer.ClientConnState) error {
b.cc.UpdateState(balancer.State{
Picker: base.NewErrPicker(b.err),
ConnectivityState: connectivity.TransientFailure,
Expand All @@ -53,10 +53,10 @@ func (b *Balancer) UpdateClientConnState(_ balancer.ClientConnState) error {
}

// ResolverError is a no-op.
func (b *Balancer) ResolverError(_ error) {}
func (b *bal) ResolverError(_ error) {}

// UpdateSubConnState is a no-op.
func (b *Balancer) UpdateSubConnState(_ balancer.SubConn, _ balancer.SubConnState) {}
func (b *bal) UpdateSubConnState(_ balancer.SubConn, _ balancer.SubConnState) {}

// Close is a no-op.
func (b *Balancer) Close() {}
func (b *bal) Close() {}
2 changes: 1 addition & 1 deletion xds/internal/balancer/cdsbalancer/cdsbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ type exitIdle struct{}

// cdsBalancer implements a CDS based LB policy. It instantiates a
// cluster_resolver balancer to further resolve the serviceName received from
// CDS, into localities and endpoints. Implements the balancer.Balancer
// CDS, into localities and endpoints. Implements the balancer.bal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. Change back.

// interface which is exposed to gRPC and implements the balancer.ClientConn
// interface which is exposed to the cluster_resolver balancer.
type cdsBalancer struct {
Expand Down