google / knative-gcp

GCP event implementations to use with Knative Eventing.
https://github.com/knative/eventing
Apache License 2.0
159 stars 75 forks source link

release-0.20: Add safeguards for Broker delivery spec nil pointer dereference #2144

Closed tommyreddad closed 3 years ago

tommyreddad commented 3 years ago

Fixes delivery spec nil pointer dereference.

Proposed Changes

Release Note

- 🐛 Fixed a potential nil pointer dereference when using a GCP Broker.
knative-prow-robot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tommyreddad

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: - ~~[OWNERS](https://github.com/google/knative-gcp/blob/release-0.20/OWNERS)~~ [tommyreddad] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
knative-metrics-robot commented 3 years ago

The following is the coverage report on the affected files. Say /test pull-google-knative-gcp-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/trigger/trigger.go 58.0% 69.5% 11.5
tommyreddad commented 3 years ago

This implements some of the changes made in https://github.com/google/knative-gcp/pull/2030, but that change is too significant to cherry-pick into an older release. Namely, see the nil pointer checks in getPubsubRetryPolicy and getPubsubDeadLetterPolicy:

zhongduo commented 3 years ago

/lgtm