Repository navigation
Fix unsafe access in multiscaler. - #2775
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@markusthoemmes: 0 warnings.
Details
In response to this:
Fixes #2774
Access to the watcher function needs to be guarded in a
nilcheck, since it's not guaranteed to be set.Release Note
NONE
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.
|
The following is the coverage report on pkg/.
|
vvraskin
left a comment
There was a problem hiding this comment.
looks good, just a small nit
| m.watcher(event) | ||
| return true | ||
| } | ||
| return false |
There was a problem hiding this comment.
Maybe better to return an error and log it for posterity? it should never happen but just in case
There was a problem hiding this comment.
It's not necessarily an error scenario, since one can choose not to set a watcher at all. After all, this is a publish/subscribe kind of pattern hence I opted to not return an error.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markusthoemmes, vvraskin 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 |
|
/lgtm |
Fixes #2774
Access to the watcher function needs to be guarded in a
nilcheck, since it's not guaranteed to be set. I also added goroutine safety for good measure.Release Note