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

Copy additional information as extensions of CE in APIServerSource #3741

Merged
merged 4 commits into from
Jul 28, 2020

Conversation

danyinggu
Copy link
Contributor

@danyinggu danyinggu commented Jul 28, 2020

Helps with #3675

Proposed Changes

  • Copy resource name, namespace and kind as extension attribute of CloudEvent in APIServerSource
    The CloudEvent has name, kind and namespace as attributes in the extension:
☁️  cloudevents.Event
Validation: valid
Context Attributes,
  specversion: 1.0
  type: dev.knative.apiserver.resource.update
  source: https://10.8.0.1:443
  subject: /apis/v1/namespaces/default/pods/busybox
  id: 6f0b8c62-7caa-4832-a73a-ea9cd76897e6
  time: 2020-07-28T15:44:55.796035817Z
  datacontenttype: application/json
Extensions,
  kind: Pod
  knativearrivaltime: 2020-07-28T15:44:55.796778825Z
  knativehistory: default-kne-trigger-kn-channel.default.svc.cluster.local
  name: busybox
  namespace: default
Data,

Release Note

The APIServerSource now set `name`, `kind` and `namespace` as extension attributes in the CloudEvent.

Docs

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 28, 2020
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 28, 2020
@danyinggu
Copy link
Contributor Author

/assign @nachocano @rhuss

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 28, 2020
@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 28, 2020
@danyinggu danyinggu changed the title Copy additional information as attributes of CE in APIServerSource Copy additional information as extensions of CE in APIServerSource Jul 28, 2020
@danyinggu
Copy link
Contributor Author

/assign @lionelvillard

@nachocano
Copy link
Contributor

/lgtm
/approve

Can you check if there is an example in knative/docs regarding showing the produced event, and add the extension there as well?
Can you add in the description of this PR that ApiServerSource now sets the name of the resource as an extension attribute in the CloudEvent, or something like that?

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danyinggu, nachocano

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 Jul 28, 2020
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 28, 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/apiserver/events/events.go 95.7% 96.2% 0.5

@danyinggu
Copy link
Contributor Author

/lgtm
/approve

Can you check if there is an example in knative/docs regarding showing the produced event, and add the extension there as well?
Can you add in the description of this PR that ApiServerSource now sets the name of the resource as an extension attribute in the CloudEvent, or something like that?

Sure. I just edited the description and release note of this PR. I will change the docs to add these additional attributes. Thanks for the reminder! :)

@nachocano
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2020
@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-integration-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:

test/e2e.TestBrokerChannelFlowTriggerV1Beta1BrokerV1Beta1
test/e2e.TestBrokerChannelFlowTriggerV1Beta1BrokerV1Beta1/InMemoryChannel-messaging.knative.dev/v1

@danyinggu
Copy link
Contributor Author

/retest

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants