Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit e045138

Browse files
author
Pablo Mercado
authored
Merge pull request #12 from triggermesh/task/add-awss3source
Add S3 Source
2 parents 130a8b4 + d497549 commit e045138

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4818
-302
lines changed

cmd/triggermesh-hook/start/start.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
commoncmd "github.com/triggermesh/scoby-hook-triggermesh/pkg/common/cmd"
88
"github.com/triggermesh/scoby-hook-triggermesh/pkg/handler"
99
"github.com/triggermesh/scoby-hook-triggermesh/pkg/handler/kuards"
10+
"github.com/triggermesh/scoby-hook-triggermesh/pkg/sources/client/s3"
11+
"github.com/triggermesh/scoby-hook-triggermesh/pkg/sources/reconciler/awss3source"
1012

1113
"github.com/triggermesh/scoby-hook-triggermesh/pkg/server"
1214
)
@@ -22,6 +24,7 @@ func (c *Cmd) Run(g *commoncmd.Globals) error {
2224
r := handler.NewRegistry([]handler.Handler{
2325
// Kuards is a temporary playground
2426
kuards.New(),
27+
awss3source.New(s3.NewClientGetter(g.KubeClient.CoreV1().Secrets), g.Logger),
2528
})
2629

2730
s := server.New(c.Path, c.Address, r, g.DynClient, g.Logger)

config/200-clusterroles.yaml

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,20 @@
1-
kind: ClusterRole
1+
# Use this aggregated ClusterRole to grant to
2+
# Scoby Hook for Triggermesh premissions on
3+
# registered objects.
24
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: ClusterRole
36
metadata:
7+
# There might be an addressable-resolver ClusterRole if Knative Eventing is installed.
8+
# This would be a duplicate for TriggerMesh's scoby that would add support for scenarios
9+
# where Knative Eventing is not installed but Knative Serving is.
410
name: scoby-hook-triggermesh
511
labels:
6-
scoby.triggermesh.io/crdregistration: "true"
7-
app.kubernetes.io/name: scoby
8-
rules:
9-
- apiGroups:
10-
- "extensions.triggermesh.io"
11-
resources:
12-
- kuards
13-
verbs:
14-
- get
15-
- list
16-
- watch
17-
18-
---
19-
20-
# ClusterRole that will be aggregated at Scoby so that it can
21-
# manage these objects.
12+
eventing.knative.dev/release: devel
13+
app.kubernetes.io/version: devel
14+
app.kubernetes.io/name: scoby-hook-triggermesh
15+
aggregationRule:
16+
clusterRoleSelectors:
17+
- matchLabels:
18+
scoby.triggermesh.io/scoby-hook-triggermesh: "true"
19+
rules: [] # Rules are automatically filled in by the controller manager.
2220

23-
kind: ClusterRole
24-
apiVersion: rbac.authorization.k8s.io/v1
25-
metadata:
26-
name: crd-registrations-scoby-kuard
27-
labels:
28-
scoby.triggermesh.io/crdregistration: "true"
29-
app.kubernetes.io/name: scoby
30-
# Do not use this role directly. These rules will be added to the "crd-registrations-scoby" role.
31-
rules:
32-
- apiGroups:
33-
- "extensions.triggermesh.io"
34-
resources:
35-
- kuards
36-
verbs:
37-
- get
38-
- list
39-
- watch
40-
- update
41-
- apiGroups:
42-
- "extensions.triggermesh.io"
43-
resources:
44-
- kuards/status
45-
verbs:
46-
- get
47-
- update
48-
- patch
49-
# If a hook is used for finalization, the finalize resource
50-
# must be added to the ClusterRole.
51-
- apiGroups:
52-
- "extensions.triggermesh.io"
53-
resources:
54-
- kuards/finalizers
55-
verbs:
56-
- list
57-
- watch
58-
- create
59-
- update
60-
- delete
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
kind: ClusterRole
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: scoby-hook-awss3sources
6+
labels:
7+
# Do not use this role directly.
8+
# These rules will be added to the "scoby-hook-triggermesh" role.
9+
scoby.triggermesh.io/scoby-hook-triggermesh: "true"
10+
app.kubernetes.io/name: scoby-hook-triggermesh
11+
rules:
12+
- apiGroups:
13+
- sources.triggermesh.io
14+
resources:
15+
- awss3sources
16+
verbs:
17+
- get
18+
19+
---
20+
21+
kind: ClusterRole
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
metadata:
24+
name: scoby-awss3sources
25+
labels:
26+
# Do not use this role directly. These rules will be added to the "crd-registrations-scoby" role.
27+
scoby.triggermesh.io/crdregistration: "true"
28+
app.kubernetes.io/name: scoby
29+
rules:
30+
- apiGroups:
31+
- sources.triggermesh.io
32+
resources:
33+
- awss3sources
34+
verbs:
35+
- get
36+
- list
37+
- watch
38+
- update
39+
- apiGroups:
40+
- sources.triggermesh.io
41+
resources:
42+
- awss3sources/status
43+
verbs:
44+
- get
45+
- update
46+
- patch
47+
# If a hook is used for finalization, the finalize resource
48+
# must be added to the ClusterRole.
49+
- apiGroups:
50+
- sources.triggermesh.io
51+
resources:
52+
- awss3sources/finalizers
53+
verbs:
54+
- update

0 commit comments

Comments
 (0)