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

Eventing TLS: Test ContainerSource with eventshub TLS receiver as sink #6957

Merged
merged 23 commits into from
May 24, 2023

Conversation

vishal-chdhry
Copy link
Member

Fixes #6937

Proposed Changes

  • Test ContainerSource with eventshub TLS receiver as sink

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

ContainerSource supports sending events to TLS endpoints, minimum TLS version is v1.2

Docs

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/test-and-release Test infrastructure, tests or release size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 18, 2023
@knative-prow knative-prow bot requested review from evankanderson and mgencur May 18, 2023 12:37
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@knative-prow knative-prow bot requested a review from pierDipi May 18, 2023 12:56
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@vishal-chdhry vishal-chdhry changed the title [WIP] Eventing TLS: Test ContainerSource with eventshub TLS receiver as sink Eventing TLS: Test ContainerSource with eventshub TLS receiver as sink May 18, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 18, 2023
@pierDipi
Copy link
Member

We need this fix to get the test to pass knative-extensions/reconciler-test#530, in addition, I've updated the PR to make it "work" #6956, like CA certs indentation for the resource, CRD update to include CACerts field, etc

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4adc287) 79.80% compared to head (68ff134) 79.80%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6957   +/-   ##
=======================================
  Coverage   79.80%   79.80%           
=======================================
  Files         244      244           
  Lines       12793    12793           
=======================================
  Hits        10209    10209           
  Misses       2078     2078           
  Partials      506      506           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

vishal-chdhry and others added 4 commits May 20, 2023 10:17
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
## Proposed Changes

- 🎁 Provide the underlying channels CACerts in the Brokers status
as an annotation (`knative.dev/channelCACerts`). Similar as the
channelsAddress is provided in the `knative.dev/channelAddress`
annoation.

---------

Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
Cron -knative-prow-robot

/cc knative/eventing-writers
/assign knative/eventing-writers

Produced by: knative-sandbox/knobots/actions/update-deps

Signed-off-by: Knative Automation <automation@knative.team>
Fixes knative#6963

<!-- Please include the 'why' behind your changes if no issue exists -->

## Proposed Changes

<!-- Please categorize your changes:
- 🎁 Add new feature
- 🐛 Fix bug
- 🧹 Update or clean up current behavior
- 🗑️ Remove feature or internal logic
-->

- use EventType v1b2 on sources `duck` controller/reconciler
- updating reconciler testing for v1b2, adding listers/factory

### Pre-review Checklist

<!-- If these boxes are not checked, you will be asked to complete these
requirements or explain why they do not apply to your PR. -->

- [ ] **At least 80% unit test coverage**
- [ ] **E2E tests** for any new behavior
- [ ] **Docs PR** for any user-facing impact
- [ ] **Spec PR** for any new API feature
- [ ] **Conformance test** for any change to the spec

**Release Note**

<!--
📄 If this change has user-visible impact, write a release
note in the block
below. Include the string "action required" if additional action is
required of
users switching to the new release, for example in case of a breaking
change.

Write as if you are speaking to users, not other Knative contributors.
If this
change has no user-visible impact, no release note is needed.
-->

```release-note
EventType v1b2 on sources `duck` controller/reconciler used
```


**Docs**

<!--
📖 If this change has user-visible impact, link to an issue or PR in
https://github.com/knative/docs.
-->

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 23, 2023
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@pierDipi
Copy link
Member

@vishal-chdhry I think you need to rebase/merge main because there are quite a few unrelated changes

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 23, 2023
@vishal-chdhry
Copy link
Member Author

@pierDipi done

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@vishal-chdhry vishal-chdhry requested a review from pierDipi May 23, 2023 15:33
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@vishal-chdhry
Copy link
Member Author

/test reconciler-tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@vishal-chdhry vishal-chdhry requested a review from pierDipi May 24, 2023 08:41
f.Stable("containersource as event source").
Must("delivers events",
assert.OnStore(sink).MatchEvent(
test.HasType("dev.knative.eventing.samples.heartbeat"),
Copy link
Member

@pierDipi pierDipi May 24, 2023

Choose a reason for hiding this comment

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

TLS tests and your PR made me realize this: knative-extensions/reconciler-test#535, so technically, this match might match events that are "rejected" so travelling in plaintext on non TLS connection, therefore, for the time being, we need the MatchKind call, similar to APIServerSource TLS test:

eventasssert.OnStore(sink).
Match(eventasssert.MatchKind(eventshub.EventReceived)).
MatchEvent(test.HasType("dev.knative.apiserver.resource.update")).
AtLeast(1),

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the matching, all the events were of type "rejected"

Copy link
Member

Choose a reason for hiding this comment

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

Ok, that's a nice finding, I believe we need to add CACerts to the SinkBinding resources (similar to changes in config/core/resources/containersource.yaml) since ContainerSource uses SinkBinding under the hood, so if CACerts is not propagated to it, it won't work

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Thanks @vishal-chdhry, I left a few suggestions but it looks good!

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
@vishal-chdhry
Copy link
Member Author

/test unit-tests

Copy link
Member

@pierDipi pierDipi 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

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2023
@knative-prow
Copy link

knative-prow bot commented May 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi, Vishal-Chdhry

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

@pierDipi
Copy link
Member

Thanks!

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2023
@pierDipi
Copy link
Member

/retest-required

@knative-prow knative-prow bot merged commit 390a0c8 into knative:main May 24, 2023
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. area/test-and-release Test infrastructure, tests or release lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eventing TLS: Test ContainerSource with eventshub TLS receiver as sink
5 participants