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 5d8435a
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)
logger.info(f"Creating container from image: {self.image}")
self._container = docker_client.run(
self.image,
Expand Down

0 comments on commit 5d8435a

Please sign in to comment.