diff --git a/pkg/registry/etcd/nse_server_test.go b/pkg/registry/etcd/nse_server_test.go index 503bcbc..2bc5338 100644 --- a/pkg/registry/etcd/nse_server_test.go +++ b/pkg/registry/etcd/nse_server_test.go @@ -1,5 +1,7 @@ // Copyright (c) 2021 Doc.ai and/or its affiliates. // +// Copyright (c) 2022 Cisco and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,6 +15,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package etcd_test import ( diff --git a/pkg/tools/deviceplugin/client.go b/pkg/tools/deviceplugin/client.go index 6fb6402..7e55688 100644 --- a/pkg/tools/deviceplugin/client.go +++ b/pkg/tools/deviceplugin/client.go @@ -29,6 +29,7 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" "github.com/networkservicemesh/sdk/pkg/tools/grpcutils" @@ -87,7 +88,7 @@ func (c *Client) StartDeviceServer(ctx context.Context, deviceServer pluginapi.D defer cancel() logger.Info("check device server operational") - conn, err := grpc.DialContext(dialCtx, socketURL.String(), grpc.WithBlock(), grpc.WithInsecure()) + conn, err := grpc.DialContext(dialCtx, socketURL.String(), grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { logger.Errorf("failed to dial kubelet api: %s", err.Error()) return "", err @@ -104,7 +105,7 @@ func (c *Client) RegisterDeviceServer(ctx context.Context, request *pluginapi.Re logger := log.FromContext(ctx).WithField("Client", "RegisterDeviceServer") socketURL := grpcutils.AddressToURL(socketpath.SocketPath(c.devicePluginSocket)) - conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return errors.Wrap(err, "cannot connect to device plugin kubelet service") } diff --git a/pkg/tools/k8stest/deviceplugin/server.go b/pkg/tools/k8stest/deviceplugin/server.go index 2ea9a1b..f958e3d 100644 --- a/pkg/tools/k8stest/deviceplugin/server.go +++ b/pkg/tools/k8stest/deviceplugin/server.go @@ -25,6 +25,7 @@ import ( "path" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" "github.com/networkservicemesh/sdk/pkg/tools/grpcutils" @@ -49,7 +50,7 @@ func (rs *registrationServer) Register(ctx context.Context, request *pluginapi.R socketPath := socketpath.SocketPath(path.Join(rs.devicePluginPath, request.Endpoint)) socketURL := grpcutils.AddressToURL(socketPath) - conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { logger.Errorf("failed to connect to %v", socketPath.String()) return nil, err diff --git a/pkg/tools/podresources/client.go b/pkg/tools/podresources/client.go index f77dc0f..e5f1bab 100644 --- a/pkg/tools/podresources/client.go +++ b/pkg/tools/podresources/client.go @@ -26,6 +26,7 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" podresources "k8s.io/kubelet/pkg/apis/podresources/v1alpha1" "github.com/networkservicemesh/sdk/pkg/tools/grpcutils" @@ -55,7 +56,7 @@ func (km *Client) GetPodResourcesListerClient(ctx context.Context) (podresources logger := log.FromContext(ctx).WithField("podresources.Client", "GetPodResourcesListerClient") socketURL := grpcutils.AddressToURL(socketpath.SocketPath(km.podResourcesSocket)) - conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithInsecure()) + conn, err := grpc.DialContext(ctx, socketURL.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, errors.Wrap(err, "cannot connect to pod resources kubelet service") }