Revert "Add 'labels:' config option"
This reverts commit 721327110d.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
02f119e4b7
commit
965426e39b
6 changed files with 3 additions and 75 deletions
|
|
@ -32,4 +32,4 @@ def docker_client():
|
|||
)
|
||||
|
||||
timeout = int(os.environ.get('DOCKER_CLIENT_TIMEOUT', 60))
|
||||
return Client(base_url=base_url, tls=tls_config, version='1.18', timeout=timeout)
|
||||
return Client(base_url=base_url, tls=tls_config, version='1.15', timeout=timeout)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ DOCKER_CONFIG_KEYS = [
|
|||
'environment',
|
||||
'hostname',
|
||||
'image',
|
||||
'labels',
|
||||
'links',
|
||||
'mem_limit',
|
||||
'net',
|
||||
|
|
@ -172,9 +171,6 @@ def process_container_options(service_dict, working_dir=None):
|
|||
if 'volumes' in service_dict:
|
||||
service_dict['volumes'] = resolve_host_paths(service_dict['volumes'], working_dir=working_dir)
|
||||
|
||||
if 'labels' in service_dict:
|
||||
service_dict['labels'] = parse_labels(service_dict['labels'])
|
||||
|
||||
return service_dict
|
||||
|
||||
|
||||
|
|
@ -336,29 +332,6 @@ def volumes_from_dict(d):
|
|||
return ["%s:%s" % (host_path, container_path) for (container_path, host_path) in d.items()]
|
||||
|
||||
|
||||
def parse_labels(labels):
|
||||
if not labels:
|
||||
return {}
|
||||
|
||||
if isinstance(labels, list):
|
||||
return dict(split_label(e) for e in labels)
|
||||
|
||||
if isinstance(labels, dict):
|
||||
return labels
|
||||
|
||||
raise ConfigurationError(
|
||||
"labels \"%s\" must be a list or mapping" %
|
||||
labels
|
||||
)
|
||||
|
||||
|
||||
def split_label(label):
|
||||
if '=' in label:
|
||||
return label.split('=', 1)
|
||||
else:
|
||||
return label, ''
|
||||
|
||||
|
||||
def expand_path(working_dir, path):
|
||||
return os.path.abspath(os.path.join(working_dir, path))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue