diff --git a/application-framework/registration/registration.go b/application-framework/registration/registration.go index 10305ba5c517a06329157240be9534d96fb3d74a..97acc4e3dfb40f6bdc9348a23e6d4766ed6c4fb8 100644 --- a/application-framework/registration/registration.go +++ b/application-framework/registration/registration.go @@ -11,7 +11,7 @@ import ( // Register registers a new app at the control plane. func Register(ctx context.Context, gosdnAddress, name, token string) (string, error) { - conn, err := grpc.Dial(gosdnAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(gosdnAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return "", err } diff --git a/applications/arista-routing-engine/app.go b/applications/arista-routing-engine/app.go index 78bce8b9de55b64dbef33c9769dd83172e9f280c..64aadaa1b061edc89e6d387afddf615c20badfb2 100644 --- a/applications/arista-routing-engine/app.go +++ b/applications/arista-routing-engine/app.go @@ -40,7 +40,7 @@ func (a *Application) Run(controllerAddress string) { }) a.eventServiceRoutes.SetupEventReciever(a.stopChannel) - conn, err := grpc.Dial(controllerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(controllerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } diff --git a/applications/basic-interface-monitoring/app.go b/applications/basic-interface-monitoring/app.go index 9f82cca697694241c8016bfec2df56fd016632ce..a2b95f1bfa51f09bca2d4ab6b7f82f4d48e25dcf 100644 --- a/applications/basic-interface-monitoring/app.go +++ b/applications/basic-interface-monitoring/app.go @@ -31,7 +31,7 @@ func (a *Application) Run(controllerAddress string) { }) a.eventServiceNetworkElements.SetupEventReciever(a.stopChannel) - conn, err := grpc.Dial(controllerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(controllerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } diff --git a/applications/hostname-checker/app.go b/applications/hostname-checker/app.go index b427236bfe7f5368328f582363743a682c26a7d2..441828a458e1f597039c645563327648c42dc5e5 100644 --- a/applications/hostname-checker/app.go +++ b/applications/hostname-checker/app.go @@ -35,7 +35,7 @@ func (a *Application) Run() { }) a.eventService.SetupEventReciever(a.stopChannel) - conn, err := grpc.Dial("localhost:55055", grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient("localhost:55055", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } diff --git a/applications/venv-manager/venv-manager/venv-manager.go b/applications/venv-manager/venv-manager/venv-manager.go index 5c4416f0608b3b35c32be000fadb03d2311b7d3e..c1d6f65107b4358c557f9c3cfbd14c11c57b87a7 100644 --- a/applications/venv-manager/venv-manager/venv-manager.go +++ b/applications/venv-manager/venv-manager/venv-manager.go @@ -50,7 +50,7 @@ func NewVenvManager(dialConnectionURL string, dialOption grpc.DialOption, topolo } func (v *VenvManager) createConnection() (*grpc.ClientConn, error) { - conn, err := grpc.Dial(v.dialConnectionURL, v.dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) + conn, err := grpc.NewClient(v.dialConnectionURL, v.dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) if err != nil { return nil, err } diff --git a/controller/controller.go b/controller/controller.go index ca31ed040a12514836c4639ffe8966b0b9a81205..7a1adbc815701addecd675dafed863cd843c6aa1 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -181,7 +181,7 @@ func initialize() error { func setupOrchestratorClient() { orchestrator := viper.GetString("csbi-orchestrator") - conn, err := grpc.Dial(orchestrator, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(orchestrator, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatal(err) } @@ -190,7 +190,7 @@ func setupOrchestratorClient() { func setupPluginRegistryClient() rpb.PluginRegistryServiceClient { pluginRegistry := viper.GetString("plugin-registry") - conn, err := grpc.Dial(pluginRegistry, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(pluginRegistry, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatal(err) } diff --git a/controller/northbound/client/app.go b/controller/northbound/client/app.go index 750af3056c54d174b6c9c07716533b0ae0a247cc..48195078acf9907c2702c1687615da8420959575 100644 --- a/controller/northbound/client/app.go +++ b/controller/northbound/client/app.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func AppClient(addr string, opts ...grpc.DialOption) (apb.AppServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/configurationManagement.go b/controller/northbound/client/configurationManagement.go index 8e008d173165d70a5098f3c0ff20605b4b089004..a88cae6d72e87cb21bb04d322bce1a4fdb5dbe53 100644 --- a/controller/northbound/client/configurationManagement.go +++ b/controller/northbound/client/configurationManagement.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func ConfigurationManagementClient(addr string, opts ...grpc.DialOption) (cpb.ConfigurationManagementServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/networkElement.go b/controller/northbound/client/networkElement.go index 58267f6ba3aac5650566c6ad04dce7f962957649..b3b71cf078ad8f44036ea6534809454fac7ae8bb 100644 --- a/controller/northbound/client/networkElement.go +++ b/controller/northbound/client/networkElement.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func NetworkElementClient(addr string, opts ...grpc.DialOption) (mnepb.NetworkElementServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/plugin.go b/controller/northbound/client/plugin.go index 5129e1fdbe9e4807b06c358faaf82f11974b9a10..e9adcdd42268b43f4bec98983b9d21a6db29e8bb 100644 --- a/controller/northbound/client/plugin.go +++ b/controller/northbound/client/plugin.go @@ -6,7 +6,7 @@ import ( ) func PluginClient(addr string, opts ...grpc.DialOption) (pipb.PluginInternalServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/pnd.go b/controller/northbound/client/pnd.go index c392566ea18f750a11c0d17df78a54872dc168c9..c239c6c695b3c9b7d7b6df464fe04d1cc458ab82 100644 --- a/controller/northbound/client/pnd.go +++ b/controller/northbound/client/pnd.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func PndClient(addr string, opts ...grpc.DialOption) (ppb.PndServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/rbac.go b/controller/northbound/client/rbac.go index c5f9a97007367435620a00a19160b7f837359df9..1c3443f4b49281060c65e21c2e33e59c1018d031 100644 --- a/controller/northbound/client/rbac.go +++ b/controller/northbound/client/rbac.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func AuthClient(addr string, opts ...grpc.DialOption) (apb.AuthServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } @@ -20,7 +20,7 @@ func AuthClient(addr string, opts ...grpc.DialOption) (apb.AuthServiceClient, er // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func UserClient(addr string, opts ...grpc.DialOption) (apb.UserServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } @@ -31,7 +31,7 @@ func UserClient(addr string, opts ...grpc.DialOption) (apb.UserServiceClient, er // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func RoleClient(addr string, opts ...grpc.DialOption) (apb.RoleServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/controller/northbound/client/sbi.go b/controller/northbound/client/sbi.go index c89d58006e4dd56258644b24d6081ef55c610d55..a07128b89d325af489ab486055368703af6b857a 100644 --- a/controller/northbound/client/sbi.go +++ b/controller/northbound/client/sbi.go @@ -9,7 +9,7 @@ import ( // the address of the gRPC endpoint and optional grpc.DialOption // as argument. func SbiClient(addr string, opts ...grpc.DialOption) (spb.SbiServiceClient, error) { - conn, err := grpc.Dial(addr, opts...) + conn, err := grpc.NewClient(addr, opts...) if err != nil { return nil, err } diff --git a/integration-tests/integrationTestUtils/integrationTestUtils.go b/integration-tests/integrationTestUtils/integrationTestUtils.go index 7f556cb825eb5b9c279be83ba0d3b767c65e15a4..b3e6442e812f2e9bfa410244dbd99540a4f22cbc 100644 --- a/integration-tests/integrationTestUtils/integrationTestUtils.go +++ b/integration-tests/integrationTestUtils/integrationTestUtils.go @@ -50,7 +50,7 @@ func CreateSecureConnection() (*grpc.ClientConn, context.Context, error) { sessionContext := CreateContextWithAuthorization(loginResp) dialOption := grpc.WithTransportCredentials(insecure.NewCredentials()) - conn, err := grpc.Dial(controllerUrl, dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) + conn, err := grpc.NewClient(controllerUrl, dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) if err != nil { return nil, nil, err } @@ -65,7 +65,7 @@ func CreateConnection() (*grpc.ClientConn, context.Context, error) { controllerUrl = controllerEnv } dialOption := grpc.WithTransportCredentials(insecure.NewCredentials()) - conn, err := grpc.Dial(controllerUrl, dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) + conn, err := grpc.NewClient(controllerUrl, dialOption, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(100*1024*1024))) if err != nil { return nil, nil, err }