oracle / oracle/oci-cloud-controller-manager

Need to check whether the variable is nil

Open
#340 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Go
Stars
158
Forks
108
PR merge metrics
No merged PRs in 30d

Description

According to line 89, resq may be nil, and resp.Body in line 96 will cause a crash.
By reading the previous code, resq cannot be nil, so we can remove the comparison in line 89.
https://github.com/oracle/oci-cloud-controller-manager/blob/220ab897fd3e8b1bd4b6b6d13a072f477453c073/pkg/oci/instance/metadata/instance_metadata.go#L89-L96

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/oci/instance/metadata/instance_metadata.go at lines 89-96 and read the preceding code to verify whether resq can be nil. Resolve the nil check as described and confirm that the resp.Body handling matches the established control flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, cloud
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.