Adding the event source to eventing-contrib

If you would like to contribute Knative’s eventing-contrib, as a starting point you can have a look at different sources there, such as KafkaSource, GithubSource and AWSSQSSource.

To generate and inject clientset, cache, informers, and listers, ensure that the specific source subdirectories has been added to the injection portion of the hack/update-codegen.sh script.

  1. # Sources
  2. +API_DIRS_SOURCES=(camel/source/pkg awssqs/pkg couchdb/source/pkg prometheus/pkg YourSourceHere/pkg)
  3. -API_DIRS_SOURCES=(camel/source/pkg awssqs/pkg couchdb/source/pkg prometheus/pkg)
  4. # Knative Injection
  5. chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
  6. ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \
  7. - knative.dev/sample-source/pkg/client knative.dev/sample-source/pkg/apis \
  8. - "samples:v1alpha1" \
  9. + knative.dev/your-source/pkg/client knative.dev/your-source/pkg/apis \
  10. + "your-name:v1alpha1" \
  11. --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt

and

  1. -i knative.dev/eventing-contrib/github/pkg/apis \
  2. - -i knative.dev/eventing-contrib/gitlab/pkg/apis
  3. + -i knative.dev/eventing-contrib/gitlab/pkg/apis \
  4. + -i knative.dev/eventing-contrib/YourSourceHere/pkg/apis