Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions eventrouter/internal/router/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ func (c *pusher) Handle(evt corev1.Event) {
return
}

out := minifyEvent(evt)
if len(evt.ManagedFields) == 0 {
evt.ManagedFields = nil
}

labels := out.GetLabels()
labels := evt.GetLabels()
if labels == nil {
labels = map[string]string{
keyCompositionID: compositionId,
}
} else {
labels[keyCompositionID] = compositionId
}
out.SetLabels(labels)
evt.SetLabels(labels)

c.notifyAll(all, out)
c.notifyAll(all, evt)
}

func (c *pusher) notifyAll(all map[string]v1alpha1.RegistrationSpec, evt corev1.Event) {
Expand Down
3 changes: 1 addition & 2 deletions eventrouter/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ spec:
image: kind.local/eventrouter:latest
imagePullPolicy: Never
args:
- --namespace=demo-system
- --insecure=true
- --debug=true
- --v=4
- --v=6
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
Expand Down
8 changes: 8 additions & 0 deletions eventrouter/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

KO_DOCKER_REPO=kind.local ko build --base-import-paths .

printf '\n\nList of current docker images loaded in KinD:\n'

kubectl get nodes kind-control-plane -o json \
| jq -r '.status.images[] | " - " + .names[-1]'
11 changes: 11 additions & 0 deletions eventrouter/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Install Registration CRD
kubectl apply -f manifests/eventrouter.krateo.io_registrations.yaml

# Deploy EventRouter
kubectl apply -f manifests/ns.yaml
kubectl apply -f manifests/sa.yaml
kubectl apply -f manifests/rbac.yaml
kubectl apply -f manifests/rbac-bind.yaml
kubectl apply -f manifests/deployment.yaml
3 changes: 3 additions & 0 deletions eventrouter/scripts/kind-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

kind get kubeconfig >/dev/null 2>&1 || kind create cluster
6 changes: 3 additions & 3 deletions eventrouter/testdata/registration.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: eventrouter.krateo.io/v1alpha1
kind: Registration
metadata:
name: eventrouter-echo
name: httpecho-registration
spec:
serviceName: EventRouter Echo
endpoint: http://127.0.0.1:9092/handle
serviceName: HTTP Echo
endpoint: http://127.0.0.1:9090/handle