Rename NewResourceClient funcs

drclau/unistor/namespace_authorizer
gamab 10 months ago
parent 36b3752490
commit 79d9969aa8
No known key found for this signature in database
GPG Key ID: 88D8810B587562C1
  1. 4
      pkg/services/apiserver/service.go
  2. 4
      pkg/storage/unified/resource/client.go
  3. 2
      pkg/storage/unified/sql/test/integration_test.go

@ -545,9 +545,9 @@ func (s *service) running(ctx context.Context) error {
func newResourceClient(conn *grpc.ClientConn, cfg *setting.Cfg) (resource.ResourceStoreClient, error) {
if cfg.StackID != "" {
return resource.NewResourceClientCloud(conn, cfg)
return resource.NewCloudResourceClient(conn, cfg)
}
return resource.NewResourceClientGRPC(conn)
return resource.NewGRPCResourceClient(conn)
}
func ensureKubeConfig(restConfig *clientrest.Config, dir string) error {

@ -44,7 +44,7 @@ func NewLocalResourceClient(server ResourceStoreServer) ResourceStoreClient {
return NewResourceStoreClient(grpchan.InterceptClientConn(channel, clientInt.UnaryClientInterceptor, clientInt.StreamClientInterceptor))
}
func NewResourceClientGRPC(conn *grpc.ClientConn) (ResourceStoreClient, error) {
func NewGRPCResourceClient(conn *grpc.ClientConn) (ResourceStoreClient, error) {
// scenario: remote on-prem
clientInt, err := authnlib.NewGrpcClientInterceptor(
&authnlib.GrpcClientConfig{},
@ -59,7 +59,7 @@ func NewResourceClientGRPC(conn *grpc.ClientConn) (ResourceStoreClient, error) {
return NewResourceStoreClient(grpchan.InterceptClientConn(conn, clientInt.UnaryClientInterceptor, clientInt.StreamClientInterceptor)), nil
}
func NewResourceClientCloud(conn *grpc.ClientConn, cfg *setting.Cfg) (ResourceStoreClient, error) {
func NewCloudResourceClient(conn *grpc.ClientConn, cfg *setting.Cfg) (ResourceStoreClient, error) {
// scenario: remote cloud
grpcClientConfig := clientCfgMapping(grpcutils.ReadGrpcClientConfig(cfg))

@ -357,7 +357,7 @@ func TestClientServer(t *testing.T) {
t.Run("Create a client", func(t *testing.T) {
conn, err := grpc.NewClient(svc.GetAddress(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
client, err = resource.NewResourceClientGRPC(conn)
client, err = resource.NewGRPCResourceClient(conn)
require.NoError(t, err)
})

Loading…
Cancel
Save