Skip to content

Commit

Permalink
drop usage of deprecated package/methods
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
(cherry picked from commit 56e8cf9)
Signed-off-by: Kirtana Ashok <[email protected]>
  • Loading branch information
dims authored and kiashok committed Aug 16, 2024
1 parent 88ac0d9 commit ba80e0d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmd/ncproxy/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,12 @@ func run(clicontext *cli.Context) error {
var cancel context.CancelFunc
dialCtx, cancel = context.WithTimeout(ctx, time.Duration(conf.Timeout)*time.Second)
defer cancel()
//nolint:staticcheck // SA1019: grpc.WithBlock is deprecated
opts = append(opts, grpc.WithBlock())
}

// TODO: use grpc.NewClient here instead
//nolint:staticcheck // SA1019: grpc.DialContext is deprecated
client, err := grpc.DialContext(dialCtx, conf.NodeNetSvcAddr, opts...)
if err != nil {
return fmt.Errorf("failed to connect to NodeNetworkService at address %s", conf.NodeNetSvcAddr)
Expand Down
2 changes: 2 additions & 0 deletions internal/tools/networkagent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ func main() {
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
defer signal.Stop(sigChan)

// TODO: replace with grpc.NewClient
//nolint:staticcheck // SA1019: grpc.Dial is deprecated, replace with grpc.NewClient
grpcClient, err := grpc.Dial(
conf.GRPCAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
Expand Down
3 changes: 3 additions & 0 deletions test/cri-containerd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ func createGRPCConn(ctx context.Context) (*grpc.ClientConn, error) {
if err != nil {
return nil, err
}

// TODO: use grpc.NewClient here instead
//nolint:staticcheck // SA1019: grpc.DialContext is deprecated
return grpc.DialContext(ctx, addr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialer))
Expand Down
5 changes: 4 additions & 1 deletion test/internal/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/containerd/containerd"
kubeutil "github.com/containerd/containerd/integration/remote/util"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/remotes/docker/config"
"github.com/containerd/containerd/snapshots"
"github.com/containerd/errdefs"
"github.com/containerd/platforms"
"github.com/opencontainers/image-spec/identity"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand All @@ -34,6 +34,9 @@ func createGRPCConn(ctx context.Context, address string) (*grpc.ClientConn, erro
if err != nil {
return nil, err
}

// TODO: use grpc.NewClient here instead
//nolint:staticcheck // SA1019: grpc.DialContext is deprecated
return grpc.DialContext(ctx, addr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialer))
Expand Down
2 changes: 1 addition & 1 deletion test/pkg/images/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package images
import (
"fmt"

"github.com/containerd/containerd/platforms"
"github.com/containerd/errdefs"
"github.com/containerd/platforms"
)

const (
Expand Down

0 comments on commit ba80e0d

Please sign in to comment.