Skip to content

Commit

Permalink
Testcontainers: Don't always pull the OCI image before starting.
Browse files Browse the repository at this point in the history
It is unfortunate in disconnected situations.
  • Loading branch information
amotl committed Oct 9, 2024
1 parent c6e42b9 commit c42ede1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
also checking `rowcount` for handling `INSERT OK, 0 rows` responses
- MongoDB: Fixed BSON decoding of `{"$date": 1180690093000}` timestamps
by updating to commons-codec 0.0.21.
- Testcontainers: Don't always pull the OCI image before starting.
It is unfortunate in disconnected situations.

## 2024/10/01 v0.0.27
- MongoDB: Updated to pymongo 4.9
Expand Down
5 changes: 3 additions & 2 deletions cratedb_toolkit/testing/testcontainers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ def start(self):
containers = docker_client.client.api.containers(all=True, filters={"name": self._name})

if not containers:
logger.info(f"Pulling image: {self.image}")
docker_client.client.images.pull(self.image)
if asbool(self._kwargs.get("pull", False)):
logger.info(f"Pulling image: {self.image}")
docker_client.client.images.pull(self.image)

Check warning on line 92 in cratedb_toolkit/testing/testcontainers/util.py

View check run for this annotation

Codecov / codecov/patch

cratedb_toolkit/testing/testcontainers/util.py#L91-L92

Added lines #L91 - L92 were not covered by tests
logger.info(f"Creating container from image: {self.image}")
self._container = docker_client.run(
self.image,
Expand Down

0 comments on commit c42ede1

Please sign in to comment.