Flow controller#189
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vaikas-google 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 |
| @@ -0,0 +1,57 @@ | |||
| # Flow Example | |||
|
|
|||
| The flow sample includes a function that listes for k8s events on a cluster and a flow | |||
There was a problem hiding this comment.
typo: s/listes/listens/
|
|
||
| ``` | ||
| ko apply -f config/buses/stub.yaml | ||
| ko apply -f config/buses/stub-bus.yaml |
There was a problem hiding this comment.
actually: ko apply -f config/buses/stub/
(or: ko apply -f config/buses/stub/stub-bus.yaml)
| return newFinalizers, nil | ||
| } | ||
|
|
||
| func newFloweNonControllerRef(et *v1alpha1.Flow) *metav1.OwnerReference { |
There was a problem hiding this comment.
typo in function name ("Flowe")
There was a problem hiding this comment.
Is this used? Also, shouldn't we use proper controller owner references?
scothis
left a comment
There was a problem hiding this comment.
looks good so far, nits inline
| # Once Route supports serviceName, use that | ||
| # kind: Route | ||
| kind: Revision | ||
| apiVersion: serving.knative.dev/v1alpha1 |
There was a problem hiding this comment.
I wish we didn't have to include apiVersion here, but Service vs Service makes that impractical.
There was a problem hiding this comment.
It's not only that, but also we need to allow other people to add Revision (or Service or whatever) that's not hardcoded. I suppose we could have 'known types' short hands notation, but I don't really like that approach.
|
|
||
| ``` | ||
| ko apply -f config/buses/stub.yaml | ||
| ko apply -f config/buses/stub-bus.yaml |
There was a problem hiding this comment.
config/buses/stub/stub-bus.yaml
| First, install the Stub bus, if not already installed. You **must** change the Kind to ClusterBus | ||
|
|
||
| ``` | ||
| ko apply -f config/buses/stub-bus.yaml |
There was a problem hiding this comment.
config/buses/stub/stub-bus.yaml
There was a problem hiding this comment.
yep, @markfisher also pointed this out, done.
There was a problem hiding this comment.
there were two, this one still needs to be updated
There was a problem hiding this comment.
oops, sorry. my bad. fixed.
|
|
||
| ## Deploy | ||
|
|
||
| First, install the Stub bus, if not already installed. You **must** change the Kind to ClusterBus |
There was a problem hiding this comment.
I assume this is a temporary restriction 😄
| return c.resolveObjectReference(namespace, action.Target) | ||
| } | ||
| if action.TargetURI != nil { | ||
| return *action.TargetURI, nil |
There was a problem hiding this comment.
There's an impedance mismatch between a uri and a service name. A service name is equivalent to a hostname.
There was a problem hiding this comment.
Yeah, I understood from Wednesday call that we wanted a URI and not just a hostname.
There was a problem hiding this comment.
we will need to deal with it where it bottoms out (Subscription in this case), recognizing whether there's a scheme or not and handling accordingly
...OR we could create an ExternalName-typed Service here and then use its name?
There was a problem hiding this comment.
I think my preference would be to flow it through to as is and let the lower levels deal with it. At least for now.
| } | ||
|
|
||
| // AddFinalizer adds value to the list of finalizers on obj | ||
| func AddFinalizer(obj runtimetypes.Object, value string) error { |
There was a problem hiding this comment.
Where is the finalizer used?
| return newFinalizers, nil | ||
| } | ||
|
|
||
| func newFloweNonControllerRef(et *v1alpha1.Flow) *metav1.OwnerReference { |
There was a problem hiding this comment.
Is this used? Also, shouldn't we use proper controller owner references?
| Subscriber: target, | ||
| }, | ||
| } | ||
| return c.clientset.ChannelsV1alpha1().Subscriptions(flow.Namespace).Create(subscription) |
There was a problem hiding this comment.
add an owner reflrence to cascade deletes
| if flow.Spec.Trigger.ParametersFrom != nil { | ||
| feed.Spec.Trigger.ParametersFrom = flow.Spec.Trigger.ParametersFrom | ||
| } | ||
|
|
|
Done, PTAL. |
|
/lgtm |
|
/lgtm |
Flows support a TargetURI as an escape hatch instead of a Target resource. This value is passed through to the Subscription's subscriber. Buses will now accept an http:// or https:// based URI as the subscriber. It is generally recomended to avoid using a URI unless nessesary. A DNS host name is preferred as it will be more compatible with the future event delivery protocol, which will detect/negotiate the underlying transport. Refs #189
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver): > Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter - [First Issue](knative#80). Opened 6/11 - [First PR](knative#66). Opened 5/31 - [First Review](knative#79 (review)) 6/11 > Primary reviewer for at least 10 substantial PRs to the codebase - knative#422 (review) - knative#414 (review) - knative#325 (review) - knative#225 (review) - knative#189 (review) - knative#168 (review) - knative#165 (review) - knative#99 (review) - knative#79 (review) - knative#111 (review) > Reviewed or merged at least 30 PRs to the codebase - [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis) - [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged) - [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis) > Nominated by an area lead From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events) /assign @vaikas-google > With no objections from other leads 🤞 /cc @evankanderson @grantr @inlined @mattmoor
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver): > Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter - [First Issue](#80). Opened 6/11 - [First PR](#66). Opened 5/31 - [First Review](#79 (review)) 6/11 > Primary reviewer for at least 10 substantial PRs to the codebase - #422 (review) - #414 (review) - #325 (review) - #225 (review) - #189 (review) - #168 (review) - #165 (review) - #99 (review) - #79 (review) - #111 (review) > Reviewed or merged at least 30 PRs to the codebase - [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis) - [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged) - [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis) > Nominated by an area lead From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events) /assign @vaikas-google > With no objections from other leads 🤞 /cc @evankanderson @grantr @inlined @mattmoor
From [ROLES.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/ROLES.md#approver): > Reviewer of the codebase for at least 3 months or 50% of project lifetime, whichever is shorter - [First Issue](knative#80). Opened 6/11 - [First PR](knative#66). Opened 5/31 - [First Review](knative#79 (review)) 6/11 > Primary reviewer for at least 10 substantial PRs to the codebase - knative#422 (review) - knative#414 (review) - knative#325 (review) - knative#225 (review) - knative#189 (review) - knative#168 (review) - knative#165 (review) - knative#99 (review) - knative#79 (review) - knative#111 (review) > Reviewed or merged at least 30 PRs to the codebase - [Reviewed 23 PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+reviewed-by%3Ascothis) - [Authored 34 merged PRs](https://github.com/knative/eventing/pulls?utf8=✓&q=is%3Apr+author%3Ascothis+is%3Amerged) - [Authored 5 open PRs](https://github.com/knative/eventing/pulls/scothis) > Nominated by an area lead From [WORKING_GROUPS.MD](https://github.com/knative/docs/blob/dfc53c67c8e80d30b8863353c9e9b4ad00c41fa0/community/WORKING-GROUPS.md#events) /assign @vaikas-google > With no objections from other leads 🤞 /cc @evankanderson @grantr @inlined @mattmoor
Addresses #178
Proposed Changes