chore: Remove reference of deprecated ioutil package and grpc methods#593
Conversation
|
Hi @chimanjain. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Can the reviewers please verify thiese changes. |
|
@andyzhangx can you please review these changes. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: andyzhangx, chimanjain The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@pohly can you please review this! |
|
Can the reviewers please verify these changes |
|
Can you rebase? |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the codebase by removing usage of deprecated Go ioutil helpers and deprecated gRPC dialing APIs, updating call sites to use current gRPC credential and client-creation patterns.
Changes:
- Replaced deprecated gRPC APIs (
WithDialer,Dial,WithInsecure) withWithContextDialer,NewClient, andWithTransportCredentials(insecure.NewCredentials()). - Replaced
ioutil.ReadFilewithos.ReadFilein sanity helpers. - Updated connection establishment flow to explicitly
Connect()and wait forconnectivity.Ready.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| utils/grpcutil.go | Migrates connection setup to grpc.NewClient/WithContextDialer, adds explicit Connect() + readiness wait loop. |
| test/driver_test.go | Updates test client credentials away from grpc.WithInsecure(). |
| pkg/sanity/sanity.go | Replaces ioutil.ReadFile with os.ReadFile and updates default dial options to insecure transport credentials. |
| driver/mock.go | Updates mock driver client connection to use insecure transport credentials. |
Comments suppressed due to low confidence (1)
test/driver_test.go:113
- If Connect fails, the test currently calls t.Errorf but then continues and will
defer conn.Close()on a potentially nil connection, causing a panic and masking the real failure. Fail fast (t.Fatalf/return) when the connection cannot be established.
conn, err := utils.Connect(s.Address(), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Errorf("Error: %s", err.Error())
}
defer conn.Close()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, chimanjain, xing-yang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
ioutilpackagegrpcmethodsWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: