Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tektoncd/triggers into elSel
Browse files Browse the repository at this point in the history
  • Loading branch information
khrm committed Sep 28, 2020
2 parents ddb01b2 + c8123cf commit b71cc04
Show file tree
Hide file tree
Showing 626 changed files with 34,392 additions and 7,238 deletions.
18 changes: 9 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ Examples of user facing changes:
For pull requests with a release note:
```release-note
Your release note here
```
```release-note
Your release note here
```
For pull requests that require additional action from users switching to the new release, include the string "action required" (case insensitive) in the release note:
```release-note
action required: your release note here
```
```release-note
action required: your release note here
```
For pull requests that don't need to be mentioned at release time, use the `/release-note-none` Prow command to add the `release-note-none` label to the PR. You can also write the string "NONE" as a release note in your PR description:
```release-note
NONE
```
```release-note
NONE
```
-->
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ configuring Kubernetes resources.
Docker for Desktop using an edge version has been proven to work for both
developing and running Pipelines. The recommended configuration is:

- Kubernetes version 1.15 or later
- Kubernetes version 1.16 or later
- 4 vCPU nodes (`n1-standard-4`)
- Node autoscaling, up to 3 nodes
- API scopes for cloud-platform
Expand All @@ -110,7 +110,7 @@ To setup a cluster with GKE:
variable (e.g. `PROJECT_ID`).

1. Create a GKE cluster (with `--cluster-version=latest` but you can use any
version 1.15 or later):
version 1.16 or later):

```bash
export PROJECT_ID=my-gcp-project
Expand Down
2 changes: 1 addition & 1 deletion cmd/triggerrun/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func processTriggerSpec(kubeClient kubernetes.Interface, client triggersclientse
client.TriggersV1alpha1().ClusterTriggerBindings().Get,
client.TriggersV1alpha1().TriggerTemplates(tri.Namespace).Get)
if err != nil {
log.Error("Failed to resolve Trigger", err)
log.Error("Failed to resolve Trigger: ", err)
return nil, err
}

Expand Down
50 changes: 24 additions & 26 deletions cmd/triggerrun/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,38 +211,36 @@ func Test_processTriggerSpec(t *testing.T) {
args args
want []json.RawMessage
wantErr bool
}{
{
name: "testing-name",
args: args{
t: &v1alpha1.Trigger{
TypeMeta: metav1.TypeMeta{
Kind: "TriggerRun",
APIVersion: "tekton.dev/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{
Name: "my-triggerRun",
}{{
name: "testing-name",
args: args{
t: &v1alpha1.Trigger{
TypeMeta: metav1.TypeMeta{
Kind: "TriggerRun",
APIVersion: "tekton.dev/v1alpha1"},
ObjectMeta: metav1.ObjectMeta{
Name: "my-triggerRun",
},
Spec: v1alpha1.TriggerSpec{
Bindings: []*v1alpha1.TriggerSpecBinding{
{Ref: "git-event-binding"}, // These should be references to TriggerBindings defined below
},
Spec: v1alpha1.TriggerSpec{
Bindings: []*v1alpha1.TriggerSpecBinding{
{Name: "git-event-binding"}, // These should be references to TriggerBindings defined below
},
Template: v1alpha1.TriggerSpecTemplate{
Name: "simple-pipeline-template", // This should be a reference to a TriggerTemplate defined below
},
Template: v1alpha1.TriggerSpecTemplate{
Name: "simple-pipeline-template", // This should be a reference to a TriggerTemplate defined below
},
},
},

request: r,
event: eventBody,
resources: test.Resources{
// Add any resources that we need to create with a fake client
TriggerBindings: []*v1alpha1.TriggerBinding{&triggerBinding},
TriggerTemplates: []*triggersv1.TriggerTemplate{&triggerTemplate},
},
request: r,
event: eventBody,
resources: test.Resources{
// Add any resources that we need to create with a fake client
TriggerBindings: []*v1alpha1.TriggerBinding{&triggerBinding},
TriggerTemplates: []*triggersv1.TriggerTemplate{&triggerTemplate},
},
want: []json.RawMessage{wantTrBytes},
},
}
want: []json.RawMessage{wantTrBytes},
}}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
53 changes: 52 additions & 1 deletion docs/eventlisteners.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ the following fields:
- [`replicas`](#replicas) - Specifies the number of EventListener pods
- [`podTemplate`](#podTemplate) - Specifies the PodTemplate
for your EventListener pod
- [`resources`](#resources) - Specifies the Kubernetes Resource information
for your EventListener pod

[kubernetes-overview]:
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields
Expand Down Expand Up @@ -199,6 +201,50 @@ spec:
effect: NoSchedule
```

### Resources

The `resources` field is optional.
Resource field helps to provide Kubernetes or custom resource information.

For more info on the design refer [TEP-0008](https://github.com/tektoncd/community/blob/master/teps/0008-support-knative-service-for-triggers-eventlistener-pod.md)

Right now the `resources` field is optional in order to support backward compatibility with original behavior of `podTemplate`, `serviceType` and `serviceAccountName` fieds.
In the future, we plan to deprecate `serviceAccountName`, `serviceType` and `podTemplate` from the EventListener spec in favor of the `resources` field.

For now `resources` has support for `kubernetesResource` but later it will have a support for Custom CRD`(ex: Knative Service)` as `customResource`

```yaml
spec:
resources:
kubernetesResource:
serviceType: NodePort
spec:
template:
metadata:
labels:
key: "value"
annotations:
key: "value"
spec:
serviceAccountName: tekton-triggers-github-sa
nodeSelector:
app: test
tolerations:
- key: key
value: value
operator: Equal
effect: NoSchedule
```

With the help of `kubernetesResource` user can specify [PodTemplateSpec](https://github.com/kubernetes/api/blob/master/core/v1/types.go#L3704).

Right now the allowed values as part of `podSpec` are
```text
ServiceAccountName
NodeSelector
Tolerations
```

### Logging

EventListener sinks are exposed as Kubernetes services that are backed by a Pod
Expand Down Expand Up @@ -373,7 +419,6 @@ kind: EventListener
metadata:
name: github-listener-interceptor
spec:
serviceAccountName: tekton-triggers-github-sa
triggers:
- name: github-listener
interceptors:
Expand All @@ -389,6 +434,12 @@ spec:
- ref: github-pr-binding
template:
name: github-template
resources:
kubernetesResource:
spec:
template:
spec:
serviceAccountName: tekton-triggers-github-sa
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use this page to add the component to an existing Kubernetes cluster.

## Pre-requisites

1. A Kubernetes cluster version 1.15 or later
1. A Kubernetes cluster version 1.16 or later

If you don't already have a cluster, you can create one for testing with
`kind`. [Install
Expand Down
7 changes: 6 additions & 1 deletion examples/github/github-eventlistener-interceptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ kind: EventListener
metadata:
name: github-listener-interceptor
spec:
serviceAccountName: tekton-triggers-github-sa
triggers:
- name: github-listener
interceptors:
Expand All @@ -20,6 +19,12 @@ spec:
- ref: github-pr-binding
template:
name: github-template
resources:
kubernetesResource:
spec:
template:
spec:
serviceAccountName: tekton-triggers-github-sa
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
Expand Down
25 changes: 12 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ go 1.14
require (
github.com/GoogleCloudPlatform/cloud-builders/gcs-fetcher v0.0.0-20191203181535-308b93ad1f39
github.com/gobuffalo/envy v1.9.0 // indirect
github.com/golang/protobuf v1.4.1
github.com/google/cel-go v0.5.1
github.com/golang/protobuf v1.4.2
github.com/google/cel-go v0.6.0
github.com/google/go-cmp v0.5.0
github.com/google/go-github/v31 v31.0.0
github.com/gorilla/mux v1.7.3
github.com/grpc-ecosystem/grpc-gateway v1.13.0 // indirect
github.com/spf13/cobra v0.0.6
github.com/tektoncd/pipeline v0.14.2
github.com/spf13/cobra v1.0.0
github.com/tektoncd/pipeline v0.16.3
github.com/tektoncd/plumbing v0.0.0-20200430135134-e53521e1d887
github.com/tidwall/gjson v1.3.5 // indirect
github.com/tidwall/sjson v1.0.4
go.uber.org/zap v1.15.0
golang.org/x/text v0.3.3 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.18.2
Expand All @@ -29,21 +28,21 @@ require (
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 // indirect
knative.dev/pkg v0.0.0-20200625173728-dfb81cf04a7c
knative.dev/pkg v0.0.0-20200702222342-ea4d6e985ba0
sigs.k8s.io/yaml v1.2.0
)

// Knative deps (release-0.15)
// Knative deps (release-0.16)
replace (
contrib.go.opencensus.io/exporter/stackdriver => contrib.go.opencensus.io/exporter/stackdriver v0.12.9-0.20191108183826-59d068f8d8ff
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v38.2.0+incompatible
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.4.0+incompatible
)

// Pin k8s deps to 1.16.5
// Pin k8s deps to 0.17.6
replace (
k8s.io/api => k8s.io/api v0.16.5
k8s.io/apimachinery => k8s.io/apimachinery v0.16.5
k8s.io/client-go => k8s.io/client-go v0.16.5
k8s.io/code-generator => k8s.io/code-generator v0.16.5
k8s.io/api => k8s.io/api v0.17.6
k8s.io/apimachinery => k8s.io/apimachinery v0.17.6
k8s.io/client-go => k8s.io/client-go v0.17.6
k8s.io/code-generator => k8s.io/code-generator v0.17.6
)
Loading

0 comments on commit b71cc04

Please sign in to comment.