Allow registering custom conditions for the Broker#3545
Allow registering custom conditions for the Broker#3545knative-prow-robot merged 2 commits intoknative:masterfrom
Conversation
|
The following jobs failed:
Job pull-knative-eventing-upgrade-tests expended all 3 retries without success. |
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
vaikas
left a comment
There was a problem hiding this comment.
Thanks for taking this on!! I understood we were going to just expose the simpler solution as described here:
#3094
I'd like to first focus on moving mt broker to use this so there's no special casing for that Broker and that also validates the model as well as makes it a good reference implementation.
What do y'all think?
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
|
The following is the coverage report on the affected files.
|
|
I'm sorry I must have misunderstood what the single broker proposal was. In my mind I had been thinking that we'd be converting the class variable to instance variable, something like this (obvs not necessarily the best place)? And hence each Broker instance would have the conditionset that it uses. But now I'm wondering if your use of the annotation to store which condition set data is really the only way to achieve this without changing the actual API shape visible to the user. Hm... @grantr @dprotaso thoughts on which way is better. Does it actually need to be persisted anywhere? (sorry, been a long week already :) ) |
| @@ -0,0 +1,62 @@ | |||
| /* | |||
There was a problem hiding this comment.
I had actually been thinking about moving them away from our API directory alltogether and into the pkg/reconciler. Does not have to be part of this PR obviously :) But again, just sharing my thoughts.
|
Instead of that field living in the Broker.Spec (what the diff shows), it really should be living in the Broker.Status for this case. and it needs the proper json status tag (not just the comment). That would also pave the way to the injection path (since we already inject the class annotations), we could just inject the whole configset for direct manipulation by the actual controller? |
|
And just to be clear, I'm not advocating that we do all these obviously as part of this, just trying to figure out the eventual shape we want things to look that would make the migration then easier. I think having it in the Broker.Status today might make it easier migration path 🤔 |
|
Thanks for tackling this @pierDipi! I haven't read the PR, so this is more a response to the comment by @vaikas about persistence. I don't understand why the flavor of ConditionSet needs to be persisted in the object if we already have the broker class annotation there. Maybe if I tried to write the code it would become more obvious. But my initial thought is that the only indicator necessary is the broker class. The controller binary knows in advance what broker class it's going to be reconciling and what conditions are necessary for that broker class, so having a field to say what condition set is being used seems redundant. In my head, the simplest solution is an exported package variable for BrokerCondSet that a controller main can override before starting controllers: func main() {
// ...
v1beta1.BrokerCondSet = myBrokerClassCondSet()
// Start controllers
}Again I haven't read the PR or tried to implement this so I don't know if this really works or if there are benefits to something more complex. I know it doesn't work if we want to support multiple broker classes in a single process (as mentioned above), and maybe there's a reason to expect we'll need that sooner rather than later. Just my thoughts from a high level. |
|
Just to clarify what I'm doing in this PR:
I'm not changing Am I missing something in the big picture that you have instead?
No, it doesn't.
If I understand correctly, this is the longterm goal of the plan: #3094 (comment)
This is what this PR does through the function |
|
Thanks! And sorry for all the thought dumping on your PR :) |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pierDipi, vaikas The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/check-cla |
|
@googlebot check-cla |
|
@vaikas No problem 😄. As I wrote before, I agree with your thoughts, in particular, this one: #3545 (comment) |
|
To clarify are you adding a dependent condition? ie. when your condition is false it changes 'Ready/Succeeded' to false? |
|
@dprotaso it's being able to add / replace the entire condition set. For example, something like kafka / rabbitmq broker might not even have a Channel, so exposing conditions that talk about them doesn't make sense. Does that make sense? |
…ions Different KafkaChannel implementation might want to have different conditions, this PR add the ability to register custom conditions like we did upstream in knative/eventing#3545 for the Broker. Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
…ions Different KafkaChannel implementation might want to have different conditions, this PR adds the ability to register custom conditions like we did upstream in knative/eventing#3545 for the Broker. Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
…ions (#117) Different KafkaChannel implementation might want to have different conditions, this PR adds the ability to register custom conditions like we did upstream in knative/eventing#3545 for the Broker. Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Fixes #3094
Proposed Changes