Skip to content

Commit

Permalink
Merge pull request #386 from NikitaSkrynnik/fix-linter
Browse files Browse the repository at this point in the history
Fix linter issues after update golangci-lint version
  • Loading branch information
denis-tingaikin authored Sep 14, 2022
2 parents 1adc517 + 0e06f6e commit 03f8801
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pkg/registry/etcd/nse_server_test.go
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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 (
Expand Down
5 changes: 3 additions & 2 deletions pkg/tools/deviceplugin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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")
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/tools/k8stest/deviceplugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/tools/podresources/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 03f8801

Please sign in to comment.