Skip to content

Commit

Permalink
update pull in podman processor!
Browse files Browse the repository at this point in the history
  • Loading branch information
elnazazmi committed Mar 12, 2024
1 parent 0625ec1 commit 97262ca
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions processes/podman_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ def connect(uri='unix:///run/podman/podman.sock'):

def pull_run_image(client, image_name, container_name, environment=None, mounts=None, network_mode=None, volumes=None, command=None):
# Pull the Docker image
for image in client.images.list():
print('image list: ', image, image.id, "\n")
if image_name not in image.labels['org.opencontainers.image.title']:
print(f"Pulling Podman image: {image_name}")
image = client.images.pull(image_name)
if client.images.list():
for image in client.images.list():
print('image list: ', image, image.id, "\n")
if image_name not in image.labels['org.opencontainers.image.title']:
print(f"Pulling Podman image: {image_name}")
image = client.images.pull(image_name)
else:
print(f"Pulling Podman image: {image_name}")
image = client.images.pull(image_name)

# Check if container with the same name exists, and remove it if it does
if container_name in client.containers.list():
Expand Down

0 comments on commit 97262ca

Please sign in to comment.