Skip to content

Commit

Permalink
feat: Webhook event source to support filtering (#2178)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy authored Sep 12, 2022
1 parent c6fa0f4 commit b9a3063
Show file tree
Hide file tree
Showing 31 changed files with 1,087 additions and 663 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.17.1"
go-version: "1.19"
- name: Add bins to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3.2.0
with:
go-version: "1.17.1"
go-version: "1.19"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -91,7 +91,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.17.1"
go-version: "1.19"
- name: Restore Go build cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: "1.17.1"
go-version: "1.19"
- name: Add bins to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v3.2.0
with:
go-version: '1.17.1'
go-version: '1.19'
- name: build
run: |
pip install mkdocs==1.3.0 mkdocs_material==8.2.9
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3.2.0
with:
go-version: 1.17.1
go-version: 1.19

- name: Build binaries
run: |
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
fi
- uses: actions/setup-go@v3.2.0
with:
go-version: 1.17.1
go-version: 1.19
- uses: actions/checkout@v3
- run: go install sigs.k8s.io/bom/cmd/bom@v0.2.0
- run: go install github.com/spdx/spdx-sbom-generator/cmd/generator@v0.0.13
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ start: image
kubectl -n argo-events wait --for=condition=Ready --timeout 60s pod --all

$(GOPATH)/bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.46.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.49.0

.PHONY: lint
lint: $(GOPATH)/bin/golangci-lint
Expand Down
63 changes: 56 additions & 7 deletions api/event-source.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 59 additions & 7 deletions api/event-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 57 additions & 1 deletion api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@
},
"webhook": {
"additionalProperties": {
"$ref": "#/definitions/io.argoproj.eventsource.v1alpha1.WebhookContext"
"$ref": "#/definitions/io.argoproj.eventsource.v1alpha1.WebhookEventSource"
},
"description": "Webhook event sources",
"type": "object"
Expand Down Expand Up @@ -2804,6 +2804,62 @@
],
"type": "object"
},
"io.argoproj.eventsource.v1alpha1.WebhookEventSource": {
"description": "CalendarEventSource describes an HTTP based EventSource",
"properties": {
"authSecret": {
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "AuthSecret holds a secret selector that contains a bearer token for authentication"
},
"endpoint": {
"description": "REST API endpoint",
"type": "string"
},
"filter": {
"$ref": "#/definitions/io.argoproj.eventsource.v1alpha1.EventSourceFilter",
"description": "Filter"
},
"maxPayloadSize": {
"description": "MaxPayloadSize is the maximum webhook payload size that the server will accept. Requests exceeding that limit will be rejected with \"request too large\" response. Default value: 1048576 (1MB).",
"format": "int64",
"type": "integer"
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"description": "Metadata holds the user defined metadata which will passed along the event payload.",
"type": "object"
},
"method": {
"description": "Method is HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content",
"type": "string"
},
"port": {
"description": "Port on which HTTP server is listening for incoming events.",
"type": "string"
},
"serverCertSecret": {
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "ServerCertPath refers the file that contains the cert."
},
"serverKeySecret": {
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "ServerKeyPath refers the file that contains private key"
},
"url": {
"description": "URL is the url of the server.",
"type": "string"
}
},
"required": [
"endpoint",
"method",
"port",
"url"
],
"type": "object"
},
"io.argoproj.sensor.v1alpha1.AWSLambdaTrigger": {
"description": "AWSLambdaTrigger refers to specification of the trigger to invoke an AWS Lambda function",
"properties": {
Expand Down
Loading

0 comments on commit b9a3063

Please sign in to comment.