SEBA-169 Identify producer of events
Change-Id: I639d74b3eaaf5c4be8f50ca574442ba5dc6b611e
diff --git a/xos/synchronizer/pull_steps/pull_pods.py b/xos/synchronizer/pull_steps/pull_pods.py
index 047fb10..89c970b 100644
--- a/xos/synchronizer/pull_steps/pull_pods.py
+++ b/xos/synchronizer/pull_steps/pull_pods.py
@@ -219,7 +219,8 @@
return
event = {"status": status,
- "name": xos_pod.name}
+ "name": xos_pod.name,
+ "producer": "k8s-sync"}
if xos_pod.id:
event["kubernetesserviceinstance_id"] = xos_pod.id
diff --git a/xos/synchronizer/tests/test_pull_pods.py b/xos/synchronizer/tests/test_pull_pods.py
index c0b8b0b..01ba354 100644
--- a/xos/synchronizer/tests/test_pull_pods.py
+++ b/xos/synchronizer/tests/test_pull_pods.py
@@ -414,6 +414,7 @@
self.assertEqual(event["name"], "my-pod")
self.assertEqual(event["status"], "created")
+ self.assertEqual(event["producer"], "k8s-sync")
self.assertEqual(event["labels"], {"foo": "bar"})
self.assertEqual(event["netinterfaces"], [{"name": "primary", "addresses": ["1.2.3.4"]}])
@@ -440,6 +441,7 @@
self.assertEqual(event["name"], "my-pod")
self.assertEqual(event["status"], "deleted")
+ self.assertEqual(event["producer"], "k8s-sync")
if __name__ == '__main__':
unittest.main()