Skip to content

xds: change ServerConfig type to have a single method to return all configured dial options  #7661

@easwars

Description

@easwars

The ServerConfig type in internal bootstrap package currently stores the credentials configured for the server config as a dial option here: https://github.com/grpc/grpc-go/blob/master/internal/xds/bootstrap/bootstrap.go#L177-L181 and it has a method to return the configured credentials as dial option here:

func (sc *ServerConfig) CredsDialOption() grpc.DialOption {

As part of #7586, we are adding more dial options to the server config, and the PR currently adds a new method to return the new dial option. Once that PR is merged, we should instead have a single method in the ServerConfig type that returns a slice of dial options.

These dial options are usually retrieved from the ServerConfig when a transport to the corresponding server is being created. This is currently where it is being used:

opts.ServerCfg.CredsDialOption(),
The caller here does not care what the dial options are, and instead of making multiple calls to retrieve all the configured dial options, it would be easier/nicer to make a single call on the ServerConfig that returns all configured dial options.

Metadata

Metadata

Labels

Area: xDSIncludes everything xDS related, including LB policies used with xDS.Type: Internal CleanupRefactors, etc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions