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.
Once you meet these requirements, you can install sources!
Before submitting a PR, see also CONTRIBUTING.md.
You must have the core of Knative Serving running on your cluster.
You must have Knative Eventing running on your cluster.
You must have ko installed.
The Go tools require that you clone the repository to the
src/knative.dev/eventing-contrib
directory in your
GOPATH
.
To check out this repository:
mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
git clone git@github.com:${YOUR_GITHUB_USERNAME}/eventing-contrib.git
cd eventing-contrib
git remote add upstream git@github.com:knative/eventing-contrib.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.
Once you've setup your development environment, install any of the sources Github Source, AWS SQS Source, Camel Source, Kafka Source with:
ko apply -f <source_name>/config # e.g. github/config
These commands are idempotent, so you can run them at any time to update your deployment.
If you applied the GitHub Source, you can see things running with:
$ kubectl -n knative-sources get pods
NAME READY STATUS RESTARTS AGE
github-controller-manager-0 1/1 Running 0 2h
You can access the Github eventing manager's logs with:
kubectl -n knative-sources logs \
$(kubectl \
-n knative-sources \
get pods \
-l control-plane=github-controller-manager \
-o name \
)
See camel/source/samples/README.md, kafka/source/README.md for instructions on installing the Camel Source and Kafka Source.
As you make changes to the code-base:
./hack/update-deps.sh
../hack/update-codegen.sh
. This also runs
./hack/update-deps.sh
.
These are both idempotent, and we expect that running these in the master
branch to produce no diffs.
To verify that your generated code is correct with the new type definition you
can run ./hack/verify-codegen.sh
. On OSX you will
need GNU diff
version 3.7 that you can install from brew
with
brew install diffutils
.
To check that the build and tests passes please see the test
documentation or simply run
./test/presubmit-tests.sh
.
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.
Running tests as you make changes to the code-base is pretty simple. See the test docs.
You can delete Knative Sources
with:
ko delete -f <source_name>/config/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。