Skip to content

Latest commit

 

History

History
126 lines (87 loc) · 3.62 KB

DEVELOPMENT.md

File metadata and controls

126 lines (87 loc) · 3.62 KB

Development

This doc explains how to setup a development environment so you can get started contributing to Knative Eventing. Also take a look at the development workflow and the test docs.

Getting started

  1. Setup Knative Serving
  2. Setup Knative Eventing
  3. Create and checkout a repo fork

Once you meet these requirements, you can install a source!

Before submitting a PR, see also CONTRIBUTING.md.

Requirements

You must have the core of Knative running on your cluster.

You must have Knative Eventing running on your cluster.

You must have ko installed.

Checkout your fork

The Go tools require that you clone the repository to the src/github.com/knative/eventing-sources directory in your GOPATH.

To check out this repository:

  1. Create your own fork of this repo
  2. Clone it to your machine:
mkdir -p ${GOPATH}/src/github.com/knative
cd ${GOPATH}/src/github.com/knative
git clone git@github.com:${YOUR_GITHUB_USERNAME}/eventing-sources.git
cd eventing-sources
git remote add upstream git@github.com:knative/eventing-sources.git
git remote set-url --push upstream no_push

Adding the upstream remote sets you up nicely for regularly syncing your fork.

Once you reach this point you are ready to do a full build and deploy as follows.

Installing a Source

Once you've setup your development environment, install all sources except gcppubsub with:

ko apply -f config/

This command is idempotent, so you can run it at any time to update your deployment.

See config/README.md for instructions on installing the gcppubsub source.

You can see things running with:

$ kubectl -n knative-sources get pods
NAME                   READY     STATUS    RESTARTS   AGE
controller-manager-0   1/1       Running   0          2h

You can access the Eventing Manager's logs with:

kubectl -n knative-sources logs $(kubectl -n knative-sources get pods -l control-plane=controller-manager -o name)

Iterating

As you make changes to the code-base, there are two special cases to be aware of:

These are both idempotent, and we expect that running these in the master branch to produce no diffs.

Once the codegen and dependency information is correct, redeploy using the same ko apply command you used Installing a Source.

Or you can clean it up completely and start again.

Tests

Running tests as you make changes to the code-base is pretty simple. See the test docs.

Clean up

You can delete Knative Sources with:

ko delete -f config/