Skip to content

Flow controller#189

Merged
google-prow-robot merged 9 commits into
knative:masterfrom
vaikas:flow-controller
Jul 13, 2018
Merged

Flow controller#189
google-prow-robot merged 9 commits into
knative:masterfrom
vaikas:flow-controller

Conversation

@vaikas
Copy link
Copy Markdown
Contributor

@vaikas vaikas commented Jul 13, 2018

Addresses #178

Proposed Changes

  • Add Flow Controller that can target objects which implement Status.ServiceName
  • For now the example targets Revision directly since Route / Service do not yet expose it
  • Flow Controller resolves the action target and creates a channel and subscription, feed and wires them all together.

@google-prow-robot
Copy link
Copy Markdown

[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

Details 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

@google-prow-robot google-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2018
@google-prow-robot google-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 13, 2018
@vaikas
Copy link
Copy Markdown
Contributor Author

vaikas commented Jul 13, 2018

/assign @scothis
/assign @mattmoor

Comment thread sample/flow/README.md Outdated
@@ -0,0 +1,57 @@
# Flow Example

The flow sample includes a function that listes for k8s events on a cluster and a flow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo: s/listes/listens/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread sample/hello/README.md Outdated

```
ko apply -f config/buses/stub.yaml
ko apply -f config/buses/stub-bus.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually: ko apply -f config/buses/stub/

(or: ko apply -f config/buses/stub/stub-bus.yaml)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Comment thread pkg/controller/flow/flow.go Outdated
return newFinalizers, nil
}

func newFloweNonControllerRef(et *v1alpha1.Flow) *metav1.OwnerReference {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo in function name ("Flowe")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this used? Also, shouldn't we use proper controller owner references?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

@scothis scothis left a comment

Choose a reason for hiding this comment

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

looks good so far, nits inline

Comment thread sample/flow/flow.yaml
# Once Route supports serviceName, use that
# kind: Route
kind: Revision
apiVersion: serving.knative.dev/v1alpha1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wish we didn't have to include apiVersion here, but Service vs Service makes that impractical.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread sample/hello/README.md Outdated

```
ko apply -f config/buses/stub.yaml
ko apply -f config/buses/stub-bus.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

config/buses/stub/stub-bus.yaml

Comment thread sample/flow/README.md Outdated
First, install the Stub bus, if not already installed. You **must** change the Kind to ClusterBus

```
ko apply -f config/buses/stub-bus.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

config/buses/stub/stub-bus.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yep, @markfisher also pointed this out, done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there were two, this one still needs to be updated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops, sorry. my bad. fixed.

Comment thread sample/flow/README.md

## Deploy

First, install the Stub bus, if not already installed. You **must** change the Kind to ClusterBus
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume this is a temporary restriction 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes :)

return c.resolveObjectReference(namespace, action.Target)
}
if action.TargetURI != nil {
return *action.TargetURI, nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's an impedance mismatch between a uri and a service name. A service name is equivalent to a hostname.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I understood from Wednesday call that we wanted a URI and not just a hostname.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is the finalizer used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed.

Comment thread pkg/controller/flow/flow.go Outdated
return newFinalizers, nil
}

func newFloweNonControllerRef(et *v1alpha1.Flow) *metav1.OwnerReference {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this used? Also, shouldn't we use proper controller owner references?

Subscriber: target,
},
}
return c.clientset.ChannelsV1alpha1().Subscriptions(flow.Namespace).Create(subscription)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add an owner reflrence to cascade deletes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

if flow.Spec.Trigger.ParametersFrom != nil {
feed.Spec.Trigger.ParametersFrom = flow.Spec.Trigger.ParametersFrom
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add owner reference

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@vaikas
Copy link
Copy Markdown
Contributor Author

vaikas commented Jul 13, 2018

Done, PTAL.

@scothis
Copy link
Copy Markdown
Contributor

scothis commented Jul 13, 2018

/lgtm

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2018
@markfisher
Copy link
Copy Markdown
Contributor

/lgtm

@google-prow-robot google-prow-robot merged commit d982c95 into knative:master Jul 13, 2018
@scothis scothis mentioned this pull request Jul 17, 2018
google-prow-robot pushed a commit that referenced this pull request Jul 17, 2018
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
scothis added a commit to scothis/eventing that referenced this pull request Sep 11, 2018
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
knative-prow-robot pushed a commit that referenced this pull request Sep 12, 2018
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
matzew pushed a commit to matzew/eventing that referenced this pull request Apr 11, 2019
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
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. 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.

5 participants