Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter issues after update golangci-lint version #386

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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