From 74fa88ef4934ebab5e404efd3179d795e645f8a7 Mon Sep 17 00:00:00 2001 From: D Appleby Date: Thu, 7 Mar 2019 17:05:41 +0000 Subject: [PATCH] Doc changes to githubsource for specifying API URL (#949) * Doc changes to githubsource for specifying API URL This commit introduces extra documentation to support the new functionality on githubsource where you can optionally specify the baseURL of the github api server - thus enabling the existing githubsource to be used against both public github and github enterprise. See https://github.com/knative/eventing-sources/pull/219 * Relative URL and quotes --- eventing/README.md | 1 + eventing/samples/github-source/README.md | 4 ++++ eventing/samples/github-source/github-source.yaml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/eventing/README.md b/eventing/README.md index a41db69ce..dca408610 100644 --- a/eventing/README.md +++ b/eventing/README.md @@ -177,6 +177,7 @@ The GitHubSource fires a new event for selected - `sink`: [ObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.12/#objectreference-v1-core) A reference to the object that should receive events. +- `githubAPIURL`: `string` Optional field to specify the base URL for API requests. Defaults to the public GitHub API if not specified, but can be set to a domain endpoint to use with GitHub Enterprise, for example, `https://github.mycompany.com/api/v3/`. This base URL should always be specified with a trailing slash. See the [GitHub Source](samples/github-source) example. diff --git a/eventing/samples/github-source/README.md b/eventing/samples/github-source/README.md index 200bd6f0c..5817d7db0 100644 --- a/eventing/samples/github-source/README.md +++ b/eventing/samples/github-source/README.md @@ -100,6 +100,10 @@ Source for a specific namespace. Be sure to replace the `ownerAndRepository` value with a valid GitHub public repository owned by your GitHub user. +If using GitHub enterprise you will need to add an additional githubAPIURL +field to the spec specifying your GitHub enterprise API endpoint, see +[here](../../README.md#githubsource) + ```yaml apiVersion: sources.eventing.knative.dev/v1alpha1 kind: GitHubSource diff --git a/eventing/samples/github-source/github-source.yaml b/eventing/samples/github-source/github-source.yaml index e649d80d0..6cabd391a 100644 --- a/eventing/samples/github-source/github-source.yaml +++ b/eventing/samples/github-source/github-source.yaml @@ -18,3 +18,5 @@ spec: apiVersion: serving.knative.dev/v1alpha1 kind: Service name: github-message-dumper +# To use GitHub Enterprise you would need to add an entry for your githubAPIURL similar to the example below +# githubAPIURL: "https://github.mycompany.com/api/v3/"