Skip to content

Commit

Permalink
Merge pull request docker#7123 from docker/bump-1.25.1
Browse files Browse the repository at this point in the history
Bump 1.25.1
  • Loading branch information
Ulysses Souza authored Jan 6, 2020
2 parents a23f391 + a82fef0 commit cc93c97
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 15 deletions.
25 changes: 19 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
Change log
==========

1.25.1-rc1 (2019-11-29)
-----------------------
1.25.1 (2020-01-06)
-------------------

### Features

- Bump `pytest-cov` 2.8.1

- Bump `flake8` 3.7.9

- Bump `coverage` 4.5.4

### Bugfixes

- Discard label `com.docker.compose.filepaths` having `None` as value. Typically, when coming from stdin
- Decode APIError explanation to unicode before usage on start and create of a container

- Reports when images that cannot be pulled and must be built

- Discard label `com.docker.compose.filepaths` having None as value. Typically, when coming from stdin

- Added OSX binary as a directory to solve slow start up time caused by MacOS Catalina binary scan

- Add OSX binary as a directory to solve slow start up time caused by MacOS Catalina binary scan
- Passed in HOME env-var in container mode (running with `script/run/run.sh`)

- Pass in HOME env-var in container mode (running with `script/run/run.sh`)
- Reverted behavior of "only pull images that we can't build" and replace by a warning informing the image we can't pull and must be built

- Revert behavior of "only pull images that we can't build" and replace by a warning informing the image we can't pull and must be built

1.25.0 (2019-11-18)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion compose/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import absolute_import
from __future__ import unicode_literals

__version__ = '1.25.1-rc1'
__version__ = '1.25.1'
8 changes: 5 additions & 3 deletions compose/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from .utils import parse_seconds_float
from .utils import truncate_id
from .utils import unique_everseen
from compose.cli.utils import binarystr_to_unicode

if six.PY2:
import subprocess32 as subprocess
Expand Down Expand Up @@ -343,7 +344,7 @@ def create_container(self,
return Container.create(self.client, **container_options)
except APIError as ex:
raise OperationFailedError("Cannot create container for service %s: %s" %
(self.name, ex.explanation))
(self.name, binarystr_to_unicode(ex.explanation)))

def ensure_image_exists(self, do_build=BuildAction.none, silent=False, cli=False):
if self.can_be_built() and do_build == BuildAction.force:
Expand Down Expand Up @@ -624,9 +625,10 @@ def start_container(self, container, use_network_aliases=True):
try:
container.start()
except APIError as ex:
if "driver failed programming external connectivity" in ex.explanation:
expl = binarystr_to_unicode(ex.explanation)
if "driver failed programming external connectivity" in expl:
log.warn("Host is already in use by another container")
raise OperationFailedError("Cannot start service %s: %s" % (self.name, ex.explanation))
raise OperationFailedError("Cannot start service %s: %s" % (self.name, expl))
return container

@property
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
coverage==4.4.2
coverage==4.5.4
ddt==1.2.0
flake8==3.5.0
flake8==3.7.9
mock==3.0.5
pytest==3.6.3
pytest-cov==2.5.1
pytest-cov==2.8.1
2 changes: 1 addition & 1 deletion script/run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

set -e

VERSION="1.25.1-rc1"
VERSION="1.25.1"
IMAGE="docker/compose:$VERSION"


Expand Down
32 changes: 31 additions & 1 deletion tests/unit/service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,37 @@ def test_create_container(self):
assert 'was built because it did not already exist' in args[0]

assert self.mock_client.build.call_count == 1
self.mock_client.build.call_args[1]['tag'] == 'default_foo'
assert self.mock_client.build.call_args[1]['tag'] == 'default_foo'

def test_create_container_binary_string_error(self):
service = Service('foo', client=self.mock_client, build={'context': '.'})
service.image = lambda: {'Id': 'abc123'}

self.mock_client.create_container.side_effect = APIError(None,
None,
b"Test binary string explanation")
with pytest.raises(OperationFailedError) as ex:
service.create_container()

assert ex.value.msg == "Cannot create container for service foo: Test binary string explanation"

def test_start_binary_string_error(self):
service = Service('foo', client=self.mock_client)
container = Container(self.mock_client, {'Id': 'abc123'})

self.mock_client.start.side_effect = APIError(None,
None,
b"Test binary string explanation with "
b"driver failed programming external "
b"connectivity")
with mock.patch('compose.service.log', autospec=True) as mock_log:
with pytest.raises(OperationFailedError) as ex:
service.start_container(container)

assert ex.value.msg == "Cannot start service foo: " \
"Test binary string explanation " \
"with driver failed programming external connectivity"
mock_log.warn.assert_called_once_with("Host is already in use by another container")

def test_ensure_image_exists_no_build(self):
service = Service('foo', client=self.mock_client, build={'context': '.'})
Expand Down

0 comments on commit cc93c97

Please sign in to comment.