Skip to content

Commit

Permalink
rename auto_conf docker label names
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Aug 2, 2017
1 parent a11b57e commit 6c19ba4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/core/test_service_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,9 @@ def test_get_check_tpls_labels(self, *args):
config_store.get_check_tpls(
image, auto_conf=True,
docker_labels=dict(zip(
['service-discovery.datadoghq.com/check_names',
'service-discovery.datadoghq.com/init_configs',
'service-discovery.datadoghq.com/instances'],
['com.datadoghq.sd.check_names',
'com.datadoghq.sd.init_configs',
'com.datadoghq.sd.instances'],
self.mock_raw_templates[image][0]))))

@mock.patch('config.get_auto_confd_path', return_value=os.path.join(
Expand Down
3 changes: 2 additions & 1 deletion utils/service_discovery/abstract_config_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
KUBE_CONTAINER_NAME = 'kube_container_name'
DOCKER_LABELS = 'docker_labels'
KUBE_ANNOTATION_PREFIX = 'service-discovery.datadoghq.com'
DOCKER_LABEL_PREFIX = 'com.datadoghq.sd'


class KeyNotFound(Exception):
Expand Down Expand Up @@ -217,7 +218,7 @@ def _get_kube_config(self, identifier, kube_annotations, kube_container_name):
return self._extract_template(identifier, prefix, kube_annotations)

def _get_docker_config(self, identifier, docker_labels):
prefix = '{}/'.format(KUBE_ANNOTATION_PREFIX)
prefix = '{}.'.format(DOCKER_LABEL_PREFIX)
return self._extract_template(identifier, prefix, docker_labels)

def _extract_template(self, identifier, key_prefix, source_dict):
Expand Down

0 comments on commit 6c19ba4

Please sign in to comment.