From 810139bd7f5ab4510b81a548adeab97d791855b5 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 24 Jan 2023 09:43:53 -0800 Subject: [PATCH 1/2] grpclb: rename `grpclb/grpclbstate` package back to `grpclb/state` --- balancer/grpclb/grpclb.go | 2 +- balancer/grpclb/grpclb_test.go | 2 +- balancer/grpclb/{grpclbstate => state}/state.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename balancer/grpclb/{grpclbstate => state}/state.go (87%) diff --git a/balancer/grpclb/grpclb.go b/balancer/grpclb/grpclb.go index b0dd72fce141..dd15810d0aeb 100644 --- a/balancer/grpclb/grpclb.go +++ b/balancer/grpclb/grpclb.go @@ -32,7 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/grpclb/grpclbstate" + grpclbstate "google.golang.org/grpc/balancer/grpclb/state" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" diff --git a/balancer/grpclb/grpclb_test.go b/balancer/grpclb/grpclb_test.go index f8fbfe03d5d1..da2df41f2af8 100644 --- a/balancer/grpclb/grpclb_test.go +++ b/balancer/grpclb/grpclb_test.go @@ -36,7 +36,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/grpclb/grpclbstate" + grpclbstate "google.golang.org/grpc/balancer/grpclb/state" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal" diff --git a/balancer/grpclb/grpclbstate/state.go b/balancer/grpclb/state/state.go similarity index 87% rename from balancer/grpclb/grpclbstate/state.go rename to balancer/grpclb/state/state.go index cece046be343..4ecfa1c21511 100644 --- a/balancer/grpclb/grpclbstate/state.go +++ b/balancer/grpclb/state/state.go @@ -16,9 +16,9 @@ * */ -// Package grpclbstate declares grpclb types to be set by resolvers wishing to -// pass information to grpclb via resolver.State Attributes. -package grpclbstate +// Package state declares grpclb types to be set by resolvers wishing to pass +// information to grpclb via resolver.State Attributes. +package state import ( "google.golang.org/grpc/resolver" @@ -27,7 +27,7 @@ import ( // keyType is the key to use for storing State in Attributes. type keyType string -const key = keyType("grpc.grpclb.grpclbstate") +const key = keyType("grpc.grpclb.state") // State contains gRPCLB-relevant data passed from the name resolver. type State struct { From 23fd83fc941bcca4c182f96109a91dd8daeb8730 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 24 Jan 2023 09:47:24 -0800 Subject: [PATCH 2/2] fix tests --- internal/resolver/dns/dns_resolver.go | 2 +- internal/resolver/dns/dns_resolver_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/resolver/dns/dns_resolver.go b/internal/resolver/dns/dns_resolver.go index d51302e65c62..b08ac30adfef 100644 --- a/internal/resolver/dns/dns_resolver.go +++ b/internal/resolver/dns/dns_resolver.go @@ -32,7 +32,7 @@ import ( "sync" "time" - grpclbstate "google.golang.org/grpc/balancer/grpclb/grpclbstate" + grpclbstate "google.golang.org/grpc/balancer/grpclb/state" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/envconfig" diff --git a/internal/resolver/dns/dns_resolver_test.go b/internal/resolver/dns/dns_resolver_test.go index bfed6a74ff38..6bfcf299b33c 100644 --- a/internal/resolver/dns/dns_resolver_test.go +++ b/internal/resolver/dns/dns_resolver_test.go @@ -34,7 +34,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/grpc/balancer" - grpclbstate "google.golang.org/grpc/balancer/grpclb/grpclbstate" + grpclbstate "google.golang.org/grpc/balancer/grpclb/state" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/leakcheck" "google.golang.org/grpc/internal/testutils"