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

Add Kafka sink finalizer #177

Merged

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Sep 15, 2020

Fixes #158

Proposed Changes

  • Add Kafka sink finalizer

Release Note

- 🎁 Add new feature
You can stream Knative HTTP CloudEvents into Apache Kafka using KafkaSink objects
  - See also KafkaSink CRD, types, and reconciler - https://github.com/knative-sandbox/eventing-kafka-broker/pull/134

Docs

@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 15, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 15, 2020
Copy link
Contributor

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)

@pierDipi
Copy link
Member Author

/assign @slinkydeveloper

@slinkydeveloper
Copy link
Contributor

/hold

I prefer to keep this on hold until we merge #162

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 15, 2020
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.

minor nit

control-plane/pkg/core/config/sinks.go Outdated Show resolved Hide resolved
@matzew
Copy link
Contributor

matzew commented Sep 15, 2020

@pierDipi
Copy link
Member Author

@matzew Sure, feel free to assign yourself to the issue: knative/docs#2814, I appreciate your help!

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@pierDipi
Copy link
Member Author

/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 Sep 16, 2020
@pierDipi
Copy link
Member Author

ERROR: timeout waiting for pods to come up
my-cluster-zookeeper-0                     1/1   Running             0     5m5s
my-cluster-zookeeper-1                     1/1   Running             0     5m5s
my-cluster-zookeeper-2                     0/1   ContainerCreating   0     5m5s
strimzi-cluster-operator-9968fd8c9-vwq4m   1/1   Running             0     5m31s

Zookeeper ...
/retest

@pierDipi
Copy link
Member Author

kafka.kafka.strimzi.io/my-cluster created
Waiting until all pods in namespace kafka are up......................................................................................................................................................
ERROR: timeout waiting for pods to come up
strimzi-cluster-operator-9968fd8c9-cs2kz   0/1   ImagePullBackOff   0     5m30s
Failed Pod (data in YAML format) - strimzi-cluster-operator-9968fd8c9-cs2kz

/retest

@pierDipi
Copy link
Member Author

ERROR: timeout waiting for pods to come up
my-cluster-zookeeper-0                     1/1   Running             0     5m8s
my-cluster-zookeeper-1                     1/1   Running             0     5m8s
my-cluster-zookeeper-2                     0/1   ContainerCreating   0     5m8s
strimzi-cluster-operator-9968fd8c9-92vh6   1/1   Running             0     5m32s

Zookeeper,
/retest

@pierDipi
Copy link
Member Author

/retest

2 similar comments
@pierDipi
Copy link
Member Author

/retest

@pierDipi
Copy link
Member Author

/retest

@slinkydeveloper
Copy link
Contributor

/retest

@pierDipi
Copy link
Member Author

pierDipi commented Sep 17, 2020

 operation.go:75: Failed to get {Pod v1}-first-filtered-event-sender ready: <nil>

#183 tries to remove flakes,
/retest

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.

Thanks for fixing some of my leftovers of the previous pr too!

control-plane/pkg/reconciler/sink/kafka_sink.go Outdated Show resolved Hide resolved
control-plane/pkg/reconciler/sink/kafka_sink.go Outdated Show resolved Hide resolved
control-plane/pkg/reconciler/sink/kafka_sink.go Outdated Show resolved Hide resolved
control-plane/pkg/reconciler/sink/kafka_sink.go Outdated Show resolved Hide resolved
control-plane/pkg/reconciler/sink/kafka_sink.go Outdated Show resolved Hide resolved
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@pierDipi
Copy link
Member Author

pierDipi commented Sep 17, 2020

@slinkydeveloper I'm not sure decontextualizing variable names and log messages is better, why do you suggest to use contract everywhere instead of specific names?
It seems too vague to me and the names shouldn't be the same as the type of the variable.
We know that in the contract there are sinks, why do we call the variable contract and not sinks? If it is for consistency I'll change names everywhere to be more specific.

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Copy link
Contributor

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@slinkydeveloper
Copy link
Contributor

@pierDipi the reason to keep those names is:

  • Name the variable as the entity it contains
  • The config map contains a json with contract entity, to me logging sinks config map is far more confusing because i don't really see any sinks entity anywhere. It's the business logic that gives the sinks meaning to the contract entity
  • One of the things I understood is that, in the long term, we might use the data plane indipendently from what is actually implementing: we could have a single data plane deployment and you could have in the same cm both sinks and brokers, the controller operates on all these. in that case, contract is contract 😄

@pierDipi
Copy link
Member Author

pierDipi commented Sep 17, 2020

Name the variable as the entity it contains

Naming is hard 😄, I would change it to name the variable as the thing it represents. :)

The config map contains a json with contract entity, to me logging sinks config map is far more confusing because i don't really see any sinks entity anywhere. It's the business logic that gives the sinks meaning to the contract entity

"contract" isn't a thing from a user perspective since they don't know anything about our terminology, anyway I updated it. :)

@pierDipi
Copy link
Member Author

pierDipi commented Sep 17, 2020

One of the things I understood is that, in the long term, we might use the data plane indipendently from what is actually implementing: we could have a single data plane deployment and you could have in the same cm both sinks and brokers, the controller operates on all these. in that case, contract is contract

I would keep them separate at least in the default setup, and you can do that already today by changing the env variables of the controller. 😉

@slinkydeveloper
Copy link
Contributor

"contract" isn't a thing from a user perspective since they don't know anything about our terminology, anyway I updated it. :)

But that's something they actually see in the protobuf schema and in the json inside the config map, that's what i mean. And end up naming with 2 different names the same thing in the logs is not a good idea too

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
control-plane/pkg/apis/eventing/v1alpha1/kafka_sink_lifecycle.go 85.7% 75.0% -10.7
control-plane/pkg/reconciler/broker/broker.go 89.2% 88.8% -0.4
control-plane/pkg/reconciler/kafka/topic.go 88.5% 88.6% 0.1
control-plane/pkg/reconciler/sink/controller.go 88.9% 90.0% 1.1
control-plane/pkg/reconciler/sink/kafka_sink.go 78.0% 84.9% 6.9

@pierDipi
Copy link
Member Author

Ready for another pass!

@slinkydeveloper
Copy link
Contributor

/lgtm
/approve

Thanks for another huge contribution!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi, 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:

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 Sep 18, 2020
@knative-prow-robot knative-prow-robot merged commit 28ed273 into knative-extensions:master Sep 18, 2020
@pierDipi pierDipi mentioned this pull request Oct 1, 2020
@pierDipi pierDipi deleted the kafka-sink-finalizer branch April 14, 2021 21:18
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request Apr 7, 2022
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
This pull request was closed.
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement KafkaSink finalizer
7 participants