Skip to content

Commit

Permalink
resolver: remove ClientConn.NewServiceConfig (#6784)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Nov 13, 2023
1 parent 8b17a4d commit 8645f95
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
5 changes: 0 additions & 5 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ type ClientConn interface {
//
// Deprecated: Use UpdateState instead.
NewAddress(addresses []Address)
// NewServiceConfig is called by resolver to notify ClientConn a new
// service config. The service config should be provided as a json string.
//
// Deprecated: Use UpdateState instead.
NewServiceConfig(serviceConfig string)
// ParseServiceConfig parses the provided service config and returns an
// object that provides the parsed config.
ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult
Expand Down
20 changes: 0 additions & 20 deletions resolver_conn_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,6 @@ func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) {
})
}

// NewServiceConfig is called by the resolver implementation to send service
// configs to gRPC.
func (ccr *ccResolverWrapper) NewServiceConfig(sc string) {
ccr.serializerScheduleLocked(func(_ context.Context) {
channelz.Infof(logger, ccr.channelzID, "ccResolverWrapper: got new service config: %s", sc)
if ccr.ignoreServiceConfig {
channelz.Info(logger, ccr.channelzID, "Service config lookups disabled; ignoring config")
return
}
scpr := parseServiceConfig(sc)
if scpr.Err != nil {
channelz.Warningf(logger, ccr.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err)
return
}
ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr})
ccr.curState.ServiceConfig = scpr
ccr.cc.updateResolverState(ccr.curState, nil)
})
}

// ParseServiceConfig is called by resolver implementations to parse a JSON
// representation of the service config.
func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ func (dr *dnsDiscoveryMechanism) NewAddress(addresses []resolver.Address) {
dr.UpdateState(resolver.State{Addresses: addresses})
}

func (dr *dnsDiscoveryMechanism) NewServiceConfig(string) {
// This method is deprecated, and service config isn't supported.
}

func (dr *dnsDiscoveryMechanism) ParseServiceConfig(string) *serviceconfig.ParseResult {
return &serviceconfig.ParseResult{Err: fmt.Errorf("service config not supported")}
}

0 comments on commit 8645f95

Please sign in to comment.