Skip to content

Commit

Permalink
Merge pull request #1 from aaron-trout/configmap-namespace
Browse files Browse the repository at this point in the history
Log namespace of the configmap being worked on
  • Loading branch information
pulledtim authored Jul 18, 2018
2 parents dd78ae9 + 1c7601c commit ad55996
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sidecar/sidecar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad55996

Please sign in to comment.