diff --git a/utils/service_discovery/sd_docker_backend.py b/utils/service_discovery/sd_docker_backend.py index 02b2f946aa..608e14fcf5 100644 --- a/utils/service_discovery/sd_docker_backend.py +++ b/utils/service_discovery/sd_docker_backend.py @@ -494,7 +494,10 @@ def _fill_tpl(self, state, c_id, instance_tpl, variables, c_tags=None): c_image = state.inspect_container(c_id).get('Config', {}).get('Image', '') # add only default c_tags to the instance to avoid duplicate tags from conf - tags = c_tags[:] + if c_tags: + tags = c_tags[:] # shallow copy of the c_tags array + else + tags = [] if tags: tpl_tags = instance_tpl.get('tags', []) if isinstance(tpl_tags, dict):