Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Add Subscription prober #433

Merged
merged 17 commits into from
Mar 20, 2021

Conversation

devguyio
Copy link
Contributor

@devguyio devguyio commented Mar 5, 2021

Proposed Changes

  • Adds a prober for the dispatcher subscriptions status

TODO

  • Proper manual testing
  • Lots of cleanup
  • Adding tests
  • Add hash support

@devguyio devguyio requested review from a team as code owners March 5, 2021 05:39
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 5, 2021
@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 5, 2021

// Get the Dispatcher Service Endpoints and propagate the status to the Channel
// endpoints has the same name as the service, so not a bug.
eps, err := endpoints.Get(ctx).Lister().Endpoints(dispatcherNamespace).Get(dispatcherName)
Copy link
Contributor

Choose a reason for hiding this comment

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

eps ?

return []status.ProbeTarget{
{
PodIPs: sets.NewString(readyIPs...),
PodPort: "8080", Port: "8080", URLs: uls,
Copy link
Contributor

Choose a reason for hiding this comment

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

PodPorts vs Port ?

@devguyio
Copy link
Contributor Author

devguyio commented Mar 5, 2021

@matzew thanks for the review, I added a TODO section in the PR description to show that this still needs proper cleanup (comments, naming, tests etc) , mainly would like a feedback on the approach.

@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 8, 2021
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2021
@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #433 (1836b97) into main (63d04bd) will decrease coverage by 0.67%.
The diff coverage is 62.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #433      +/-   ##
==========================================
- Coverage   73.80%   73.13%   -0.68%     
==========================================
  Files         138      138              
  Lines        5326     5483     +157     
==========================================
+ Hits         3931     4010      +79     
- Misses       1148     1225      +77     
- Partials      247      248       +1     
Impacted Files Coverage Δ
...onsolidated/dispatcher/consumer_message_handler.go 0.00% <0.00%> (ø)
...l/consolidated/reconciler/controller/controller.go 0.00% <0.00%> (ø)
...annel/consolidated/reconciler/controller/lister.go 0.00% <0.00%> (ø)
pkg/source/adapter/adapter.go 61.29% <0.00%> (-1.01%) ⬇️
...consolidated/reconciler/controller/kafkachannel.go 47.24% <46.15%> (+3.90%) ⬆️
pkg/common/consumer/consumer_handler.go 73.07% <57.14%> (-10.26%) ⬇️
pkg/channel/consolidated/status/status.go 74.50% <74.50%> (ø)
pkg/channel/consolidated/dispatcher/dispatcher.go 65.14% <100.00%> (+1.88%) ⬆️
...nnel/consolidated/dispatcher/kafka_subscription.go 100.00% <100.00%> (ø)
...kg/channel/consolidated/dispatcher/subscription.go 0.00% <0.00%> (-53.85%) ⬇️
... and 4 more

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 63d04bd...1836b97. Read the comment docs.

@devguyio devguyio force-pushed the controller-poc branch 2 times, most recently from c95b5c4 to c726d9b Compare March 8, 2021 12:41
Copy link
Contributor

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

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

This is going in the right direction :)

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2021
@matzew
Copy link
Contributor

matzew commented Mar 11, 2021

Looking at TLS failures. Is the prober able to access a secured instance of apache kafka ?

@matzew
Copy link
Contributor

matzew commented Mar 11, 2021

@maschmid is it worth to add your test case for this scenario to this PR, or a follow up PR ?

eg. link to your testcase for that?

@matzew
Copy link
Contributor

matzew commented Mar 20, 2021

/lgtm
/approve

@devguyio can we get backport for 0.20 and 0.21?

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, slinkydeveloper

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 [matzew,slinkydeveloper]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@devguyio
Copy link
Contributor Author

Yep. Will work on it.
/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 20, 2021
@knative-prow-robot knative-prow-robot merged commit 80166e5 into knative-extensions:main Mar 20, 2021
devguyio added a commit to devguyio/eventing-kafka that referenced this pull request Mar 25, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
devguyio added a commit to devguyio/eventing-kafka that referenced this pull request Mar 25, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
matzew pushed a commit to matzew/eventing-kafka that referenced this pull request Mar 25, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
devguyio added a commit to devguyio/eventing-kafka that referenced this pull request Mar 25, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
knative-prow-robot pushed a commit that referenced this pull request Mar 25, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
matzew pushed a commit to matzew/eventing-kafka that referenced this pull request Mar 25, 2021
)

* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
knative-prow-robot pushed a commit that referenced this pull request Mar 25, 2021
* Add http endpoint to communicate dispatcher readySubscriber status (#344)

* Groundwork for dispatcher subscriber status w/ consumers

* Add functionality to serve http of subscribers

* Drop callback functions

* Fix failing unit test, add unsub check for chanref

* Rework http handler to be dispatcher local (not kafkasubscription)

* Variable typo fix

* Fix copyright years

* Change header name to constant

* Move subscription handler to its own ServeHTTP func

* Remove channelRef in KafkaSubscription

* Change bad channelref request to http.StatusNotFound

* Add namespace to subscriptions http output

* Add Unit tests for servehttp & setready

* Split uriSplit into channelRefName{,space} vars

* Expose dispatcher http-sub-status port in disatcher svc

* Add servehttp diagnostic messages

* One more uriSplit -> channelRefName variable rename

* Change how we write the http response

* Add empty SetReady() method to source RA

* Fix consumer_handler_test

* more linting

* Add back ObserveKind until controller implements substatus scraper

* Add more ServeHTTP unit tests

* slightly alter where we mark a handler as ready or not

* Add Subscription prober (#433)

* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Do not test controller name from generated source which can change. (#320)

* Update codegen

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

Co-authored-by: Lukas Berk <lberk@redhat.com>
Co-authored-by: Travis Minke <travis.minke@sap.com>
matzew pushed a commit to matzew/eventing-kafka that referenced this pull request Mar 25, 2021
* Add http endpoint to communicate dispatcher readySubscriber status (knative-extensions#344)

* Groundwork for dispatcher subscriber status w/ consumers

* Add functionality to serve http of subscribers

* Drop callback functions

* Fix failing unit test, add unsub check for chanref

* Rework http handler to be dispatcher local (not kafkasubscription)

* Variable typo fix

* Fix copyright years

* Change header name to constant

* Move subscription handler to its own ServeHTTP func

* Remove channelRef in KafkaSubscription

* Change bad channelref request to http.StatusNotFound

* Add namespace to subscriptions http output

* Add Unit tests for servehttp & setready

* Split uriSplit into channelRefName{,space} vars

* Expose dispatcher http-sub-status port in disatcher svc

* Add servehttp diagnostic messages

* One more uriSplit -> channelRefName variable rename

* Change how we write the http response

* Add empty SetReady() method to source RA

* Fix consumer_handler_test

* more linting

* Add back ObserveKind until controller implements substatus scraper

* Add more ServeHTTP unit tests

* slightly alter where we mark a handler as ready or not

* Add Subscription prober (knative-extensions#433)

* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Do not test controller name from generated source which can change. (knative-extensions#320)

* Update codegen

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

Co-authored-by: Lukas Berk <lberk@redhat.com>
Co-authored-by: Travis Minke <travis.minke@sap.com>
matzew pushed a commit to matzew/eventing-kafka that referenced this pull request Mar 26, 2021
* Add http endpoint to communicate dispatcher readySubscriber status (knative-extensions#344)

* Groundwork for dispatcher subscriber status w/ consumers

* Add functionality to serve http of subscribers

* Drop callback functions

* Fix failing unit test, add unsub check for chanref

* Rework http handler to be dispatcher local (not kafkasubscription)

* Variable typo fix

* Fix copyright years

* Change header name to constant

* Move subscription handler to its own ServeHTTP func

* Remove channelRef in KafkaSubscription

* Change bad channelref request to http.StatusNotFound

* Add namespace to subscriptions http output

* Add Unit tests for servehttp & setready

* Split uriSplit into channelRefName{,space} vars

* Expose dispatcher http-sub-status port in disatcher svc

* Add servehttp diagnostic messages

* One more uriSplit -> channelRefName variable rename

* Change how we write the http response

* Add empty SetReady() method to source RA

* Fix consumer_handler_test

* more linting

* Add back ObserveKind until controller implements substatus scraper

* Add more ServeHTTP unit tests

* slightly alter where we mark a handler as ready or not

* Add Subscription prober (knative-extensions#433)

* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Do not test controller name from generated source which can change. (knative-extensions#320)

* Update codegen

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

Co-authored-by: Lukas Berk <lberk@redhat.com>
Co-authored-by: Travis Minke <travis.minke@sap.com>
openshift-merge-robot referenced this pull request in openshift-knative/eventing-kafka Mar 26, 2021
* Add http endpoint to communicate dispatcher readySubscriber status (#344)

* Groundwork for dispatcher subscriber status w/ consumers

* Add functionality to serve http of subscribers

* Drop callback functions

* Fix failing unit test, add unsub check for chanref

* Rework http handler to be dispatcher local (not kafkasubscription)

* Variable typo fix

* Fix copyright years

* Change header name to constant

* Move subscription handler to its own ServeHTTP func

* Remove channelRef in KafkaSubscription

* Change bad channelref request to http.StatusNotFound

* Add namespace to subscriptions http output

* Add Unit tests for servehttp & setready

* Split uriSplit into channelRefName{,space} vars

* Expose dispatcher http-sub-status port in disatcher svc

* Add servehttp diagnostic messages

* One more uriSplit -> channelRefName variable rename

* Change how we write the http response

* Add empty SetReady() method to source RA

* Fix consumer_handler_test

* more linting

* Add back ObserveKind until controller implements substatus scraper

* Add more ServeHTTP unit tests

* slightly alter where we mark a handler as ready or not

* Add Subscription prober (#433)

* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Do not test controller name from generated source which can change. (#320)

* Update codegen

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

Co-authored-by: Lukas Berk <lberk@redhat.com>
Co-authored-by: Travis Minke <travis.minke@sap.com>

Co-authored-by: Ahmed Abdalla Abdelrehim <aabdelre@redhat.com>
Co-authored-by: Lukas Berk <lberk@redhat.com>
Co-authored-by: Travis Minke <travis.minke@sap.com>
devguyio referenced this pull request in openshift-knative/eventing-kafka Mar 29, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
openshift-merge-robot referenced this pull request in openshift-knative/eventing-kafka Mar 29, 2021
* Add Subscription prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix endpoints informer in cons. KafkaChannel controller

* Fix unittests after adding status prober

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Format and order go imports in cons. channel controller

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Rename import alias and remove unused variable

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Add dispatcher prober test for tesitng a single pod

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Support probing dispatchers for multiple partitions kafka channels

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Update deps

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix conumer handler test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* remove unused hashes from status probing test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Apply review comments and add a prober test

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove old comment

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Fix fake status manager

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Return error if IsReady returns an error

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Change probing to be partition based and fix some corner cases of channel deletion

* Change cleanup logic to clean ready subscriptions only

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

* Remove cleanup to avaid consumers race

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>

Co-authored-by: Ahmed Abdalla Abdelrehim <aabdelre@redhat.com>
matzew added a commit to matzew/eventing-kafka that referenced this pull request Nov 15, 2021
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
matzew added a commit to matzew/eventing-kafka that referenced this pull request Nov 15, 2021
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
pierDipi pushed a commit to pierDipi/eventing-kafka that referenced this pull request Nov 15, 2021
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
matzew added a commit to matzew/eventing-kafka that referenced this pull request Nov 16, 2021
…sions#435)

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
devguyio pushed a commit to devguyio/eventing-kafka that referenced this pull request Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants