Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ FROM node:10
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
# A wildcard is used to ensure both package.json AND package-lock.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this still have the "are copied where available", or maybe some other wording - "are copied' without adding where available.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's highly likely that developers are using npm@5 or newer, since npm@5 was released with Node * in 2017.

COPY package*.json ./

RUN npm install
Expand Down
12 changes: 7 additions & 5 deletions docs/eventing/samples/writing-event-source-easy-way/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
As stated in [tutorial on writing a Source with a Receive Adapter](../writing-receive-adapter-source/README.md), there are multiple ways to
create event sources. The way in that tutorial is to create an independent event source that has its own CRD.

In this tutorial though, you will build an event source in Javascript and use it with
[ContainerSource](../../../eventing/sources/README.md#meta-sources) and / or [SinkBinding](../../../eventing/sources/README.md#meta-sources).
This tutorial provides a simpler mechanism to build an event source in Javascript and use it with
[ContainerSource](../../../eventing/sources/README.md#meta-sources) and / or the [SinkBinding](../../../eventing/sources/README.md#meta-sources).

[ContainerSource](../../../eventing/sources/README.md#meta-sources) is an easy way to turn any dispatcher container into an Event Source.
Similarly, another option is using [SinkBinding](../../../eventing/sources/README.md#meta-sources)
which provides a framework for injecting environment variables into any Kubernetes resource which has a `spec.template` that looks like a Pod (aka PodSpecable).

Code for this tutorial is available [here](./).
SinkBinding is a newer concept and it should be preferred over ContainerSource.

Code for this tutorial is available [here](https://github.com/knative/docs/tree/master/docs/eventing/samples/writing-event-source-easy-way).

# Bootstrapping

Expand Down Expand Up @@ -131,7 +133,7 @@ EOS

Check the logs of the event display service. You will see a new message is pushed every second:
```bash
$ kubectl logs event-display-dpplv-deployment-67c9949cf9-bvjvk -c user-container
$ kubectl logs -l serving.knative.dev/service=event-display -c user-container

☁️ cloudevents.Event
Validation: valid
Expand All @@ -147,7 +149,7 @@ Data,
}
```

If you are interested in to see what is injected into the event source, check the logs of it:
If you are interested in seeing what is injected into the event source as a `K_SINK`, you can check the logs:
```bash
$ kubectl logs test-heartbeats-deployment-7575c888c7-85w5t

Expand Down