Skip to content
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 nil-pointer panic on reportError #4391

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

embano1
Copy link
Contributor

@embano1 embano1 commented Oct 26, 2020

If result is nil due to Unwrap() or when passed to reportError, the code
would panic on err.Error().

Fixes: #4378

Signed-off-by: Michael Gasch mgasch@vmware.com

Proposed Changes

Release Note


Docs

If result is nil due to Unwrap() or when passed to reportError, the code
would panic on `err.Error()`.

Closes: knative#4378

Signed-off-by: Michael Gasch <mgasch@vmware.com>
@google-cla
Copy link

google-cla bot commented Oct 26, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no Indicates the PR's author has not signed the CLA. label Oct 26, 2020
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 26, 2020
@knative-prow-robot
Copy link
Contributor

Welcome @embano1! It looks like this is your first PR to knative/eventing 🎉

@knative-prow-robot
Copy link
Contributor

Hi @embano1. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 26, 2020
@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #4391 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4391      +/-   ##
==========================================
- Coverage   81.13%   81.12%   -0.02%     
==========================================
  Files         287      287              
  Lines        8032     8033       +1     
==========================================
  Hits         6517     6517              
- Misses       1128     1129       +1     
  Partials      387      387              
Impacted Files Coverage Δ
pkg/adapter/v2/cloudevents.go 62.50% <0.00%> (-0.72%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8ba1df...b2049a5. Read the comment docs.

@lionelvillard
Copy link
Member

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 26, 2020
@lionelvillard
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2020
@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/adapter/v2/cloudevents.go 66.7% 65.8% -0.9

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2020

Looks like some of the tests failed with:

        send_event.go:63: Failed to send event Validation: valid
            Context Attributes,
              specversion: 1.0
              type: type1
              source: source1
              id: 3d0cbe40-4ebf-4e39-8df1-27ae9a82da5b
              datacontenttype: application/json
            Data (binary),
              {
                "msg": "e2e-eventtransformation-body"
              }

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2020

@thisisnotapril Any ideas what's going on here wrt CLA?

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2020

Looks like all the e2e tests failed with something like this:

        creation.go:757: Creating pod &Pod{ObjectMeta:{e2e-eventtransformation-sender  test-event-transformation-for-trigger-v1-beta1-broker-v1-cjdxmd    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] []  []},Spec:PodSpec{Volumes:[]Volume{},Containers:[]Container{Container{Name:event-sender,Image:kind.local/event-sender:latest,Command:[],Args:[-sink http://broker-ingress.knative-eventing.svc.c329539220.local/test-event-transformation-for-trigger-v1-beta1-broker-v1-cjdxmd/channel -event {"data_base64":"eyJtc2ciOiJlMmUtZXZlbnR0cmFuc2Zvcm1hdGlvbi1ib2R5In0=","datacontenttype":"application/json","id":"3d0cbe40-4ebf-4e39-8df1-27ae9a82da5b","source":"source1","specversion":"1.0","type":"type1"}],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{EnvVar{Name:K_CONFIG_TRACING,Value:{"backend":"zipkin","debug":"true","sample-rate":"1","zipkin-endpoint":"http://zipkin.knative-eventing.svc.c329539220.local:9411/api/v2/spans"},ValueFrom:nil,},},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},},VolumeMounts:[]VolumeMount{},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,},},RestartPolicy:Never,TerminationGracePeriodSeconds:nil,ActiveDeadlineSeconds:nil,DNSPolicy:,NodeSelector:map[string]string{},ServiceAccountName:,DeprecatedServiceAccount:,NodeName:,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:nil,ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{},HostAliases:[]HostAlias{},PriorityClassName:,Priority:nil,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:nil,PreemptionPolicy:nil,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},},Status:PodStatus{Phase:,Conditions:[]PodCondition{},Message:,Reason:,HostIP:,PodIP:,StartTime:<nil>,ContainerStatuses:[]ContainerStatus{},QOSClass:,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{},EphemeralContainerStatuses:[]ContainerStatus{},},}
        send_event.go:63: Failed to send event Validation: valid
            Context Attributes,
              specversion: 1.0
              type: type1
              source: source1
              id: 3d0cbe40-4ebf-4e39-8df1-27ae9a82da5b
              datacontenttype: application/json
            Data (binary),
              {
                "msg": "e2e-eventtransformation-body"
              }
             to http://broker-ingress.knative-eventing.svc.c329539220.local/test-event-transformation-for-trigger-v1-beta1-broker-v1-cjdxmd/channel: timed out waiting for the condition
            knative.dev/eventing/test/lib.(*Client).SendEvent
            	/home/runner/work/eventing/eventing/src/knative.dev/eventing/test/lib/send_event.go:63
            knative.dev/eventing/test/lib.(*Client).SendEventToAddressable
            	/home/runner/work/eventing/eventing/src/knative.dev/eventing/test/lib/send_event.go:45
            knative.dev/eventing/test/e2e/helpers.EventTransformationForTriggerTestHelper
            	/home/runner/work/eventing/eventing/src/knative.dev/eventing/test/e2e/helpers/broker_event_transformation_test_helper.go:134

@n3wscott

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2020

@n3wscott @slinkydeveloper

@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Oct 26, 2020

@vaikas solving the flakyness right now 😄 #4393

@embano1
Copy link
Contributor Author

embano1 commented Oct 26, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes Indicates the PR's author has signed the CLA. and removed cla: no Indicates the PR's author has not signed the CLA. labels Oct 26, 2020
Copy link
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

Thanks!!

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embano1, n3wscott

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2020
@knative-prow-robot knative-prow-robot merged commit e72a17c into knative:master Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nil pointer exception on v2.(*client).reportError()
7 participants