Network label mismatch now prints a warning instead of raising an error

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-05-22 14:52:57 -07:00
parent 972fe65830
commit 2ba9cd73d1
2 changed files with 10 additions and 4 deletions

View file

@ -188,10 +188,13 @@ def check_remote_network_config(remote, local):
local_labels = local.labels or {}
remote_labels = remote.get('Labels', {})
for k in set.union(set(remote_labels.keys()), set(local_labels.keys())):
if k.startswith('com.docker.compose.'): # We are only interested in user-specified labels
if k.startswith('com.docker.'): # We are only interested in user-specified labels
continue
if remote_labels.get(k) != local_labels.get(k):
raise NetworkConfigChangedError(local.full_name, 'label "{}"'.format(k))
log.warn(
'Network {}: label "{}" has changed. It may need to be'
' recreated.'.format(local.full_name, k)
)
def build_networks(name, config_data, client):