+
Skip to content

grpc.WithBlock is deprecated #9254

Closed
Closed
@andreaskaris

Description

@andreaskaris

What happened?

The linter isn't happy due to a deprecated GRPC antipattern being in use:

DEBU [gocritic] Final not used checks (2): filepathJoin, whyNoLint 
test/nri/runtime.go:50:3: SA1019: grpc.WithBlock is deprecated: this DialOption is not supported by NewClient. Will be supported throughout 1.x. (staticcheck)
		grpc.WithBlock(),
		^
test/nri/runtime.go:51:3: SA1019: grpc.FailOnNonTempDialError is deprecated: this DialOption is not supported by NewClient. This API may be changed or removed in a later release. (staticcheck)
		grpc.FailOnNonTempDialError(true),
		^
test/nri/runtime.go:54:13: SA1019: grpc.DialContext is deprecated: use NewClient instead.  Will be supported throughout 1.x. (staticcheck)
	cc, err := grpc.DialContext(ctx, *crioSocket, dialOpts...)
	           ^
3 issues:
* staticcheck: 3

See https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md#especially-bad-using-deprecated-dialoptions

According to grpc/grpc-go#7090, disabling the linter is a (temporary) option. I'm opening this bug report to make sure that an actual rewrite to non-deprecated code will happen in the future.

What did you expect to happen?

linter not to fail, production code not to be deprecated

How can we reproduce it (as minimally and precisely as possible)?

.

Anything else we need to know?

No response

CRI-O and Kubernetes version

$ crio --version
# paste output here
$ kubectl version --output=json
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

Additional environment details (AWS, VirtualBox, physical, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载