diff --git a/eventrouter/internal/router/handler.go b/eventrouter/internal/router/handler.go index 3d2ba75..73e2216 100644 --- a/eventrouter/internal/router/handler.go +++ b/eventrouter/internal/router/handler.go @@ -71,9 +71,11 @@ 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, @@ -81,9 +83,9 @@ func (c *pusher) Handle(evt corev1.Event) { } 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) { diff --git a/eventrouter/manifests/deployment.yaml b/eventrouter/manifests/deployment.yaml index 982d8b2..8bcd9d2 100644 --- a/eventrouter/manifests/deployment.yaml +++ b/eventrouter/manifests/deployment.yaml @@ -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 diff --git a/eventrouter/scripts/build.sh b/eventrouter/scripts/build.sh new file mode 100755 index 0000000..513fa3c --- /dev/null +++ b/eventrouter/scripts/build.sh @@ -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]' \ No newline at end of file diff --git a/eventrouter/scripts/install.sh b/eventrouter/scripts/install.sh new file mode 100755 index 0000000..1abd221 --- /dev/null +++ b/eventrouter/scripts/install.sh @@ -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 diff --git a/eventrouter/scripts/kind-up.sh b/eventrouter/scripts/kind-up.sh new file mode 100755 index 0000000..4b35aa0 --- /dev/null +++ b/eventrouter/scripts/kind-up.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +kind get kubeconfig >/dev/null 2>&1 || kind create cluster diff --git a/eventrouter/testdata/registration.sample.yaml b/eventrouter/testdata/registration.sample.yaml index ba38d1a..f29e748 100644 --- a/eventrouter/testdata/registration.sample.yaml +++ b/eventrouter/testdata/registration.sample.yaml @@ -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 \ No newline at end of file + serviceName: HTTP Echo + endpoint: http://127.0.0.1:9090/handle \ No newline at end of file