From 1c7601cb06f0a9b2fb4d8a5595d459fb09d96a1f Mon Sep 17 00:00:00 2001 From: Aaron Trout Date: Mon, 9 Jul 2018 10:48:06 +0100 Subject: [PATCH] Also log namespace of the configmap --- sidecar/sidecar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sidecar/sidecar.py b/sidecar/sidecar.py index fcb186a8..76dab18c 100644 --- a/sidecar/sidecar.py +++ b/sidecar/sidecar.py @@ -21,9 +21,10 @@ def watchForChanges(label, targetFolder): v1 = client.CoreV1Api() w = watch.Watch() for event in w.stream(v1.list_config_map_for_all_namespaces): - if event['object'].metadata.labels is None: + metadata = event['object'].metadata + if metadata.labels is None: continue - print("Working on configmap %s" % event['object'].metadata.name) + print(f'Working on configmap {metadata.namespace}/{metadata.name}') if label in event['object'].metadata.labels.keys(): print("Configmap with label found") dataMap=event['object'].data