-
Notifications
You must be signed in to change notification settings - Fork 280
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: azure_loadbalancer.go: don't use service.Name, when service is nil #5266
fix: azure_loadbalancer.go: don't use service.Name, when service is nil #5266
Conversation
/assign @feiskyer @nilo19 @MartinForReal |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damdo, nilo19 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherrypick release-1.28 |
@nilo19: new pull request created: #5269 In response to this:
Instructions 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/test-infra repository. |
/cherrypick release-1.27 |
/cherrypick release-1.26 |
/cherrypick release-1.25 |
@nilo19: new pull request created: #5273 In response to this:
Instructions 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/test-infra repository. |
@nilo19: new pull request created: #5274 In response to this:
Instructions 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/test-infra repository. |
@nilo19: new pull request created: #5275 In response to this:
Instructions 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/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Summary:
The
service
object is alwaysnil
when code execution reaches this line and as such, loggingservice.Name
will result in a nil pointer dereference panic (see this panic log (note that this comes from an older fork, so panic code lines might not exactly match)).Analysis:
If
if !serviceExists
is satisfied, we log a line withservice.Name
But for the execution to branch into
if !serviceExists
,serviceExists
must be false.Looking at
getLatestService
whereservice
andserviceExists
come from, you’ll see that the only case whenserviceExists
isfalse
, service isnil
, resulting in a nil pointer dereference panic.Changing to
serviceName
(a pre populated string) instead ofservice.Name
should fix this issue.Does this PR introduce a user-facing change?