From 8645f95509d6c5d17a54621407f3ca717d4f8620 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Mon, 13 Nov 2023 14:10:32 -0800 Subject: [PATCH] resolver: remove ClientConn.NewServiceConfig (#6784) --- resolver/resolver.go | 5 ----- resolver_conn_wrapper.go | 20 ------------------- .../clusterresolver/resource_resolver_dns.go | 4 ---- 3 files changed, 29 deletions(-) diff --git a/resolver/resolver.go b/resolver/resolver.go index c9411907d3e5..bd1c7d01b7ec 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -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 diff --git a/resolver_conn_wrapper.go b/resolver_conn_wrapper.go index d68330560848..ce03600090b0 100644 --- a/resolver_conn_wrapper.go +++ b/resolver_conn_wrapper.go @@ -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 { diff --git a/xds/internal/balancer/clusterresolver/resource_resolver_dns.go b/xds/internal/balancer/clusterresolver/resource_resolver_dns.go index 9052190b0ff0..27871a298fe2 100644 --- a/xds/internal/balancer/clusterresolver/resource_resolver_dns.go +++ b/xds/internal/balancer/clusterresolver/resource_resolver_dns.go @@ -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")} }