Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/gardenlinux/oci/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,13 @@ def tag(
:since: 1.0.0
"""

oci_data = oci_container_tag.rsplit(":", 1)
if ":" in oci_container_tag:
oci_data = oci_container_tag.rsplit(":", 1)

if len(oci_data) < 2:
raise RuntimeError("No tag given")
if len(oci_data) < 2:
raise RuntimeError("No tag given")
else:
oci_data = ["", oci_container_tag]

image = podman.images.get(image_id)
image.tag(oci_data[0], oci_data[1])
Expand Down
10 changes: 7 additions & 3 deletions src/gardenlinux/oci/podman_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,19 @@ def _wait_for_socket(self, sock: str) -> None:
:since: 1.0.0
"""

# Use variable for status to catch corner cases of fast closing sockets
is_socket_available = False
sock_path = Path(sock)

for _ in range(0, 5 * PODMAN_CONNECTION_MAX_IDLE_SECONDS):
if sock_path.exists():
for _ in range(0, 50 * PODMAN_CONNECTION_MAX_IDLE_SECONDS):
is_socket_available = sock_path.exists()

if is_socket_available:
break

sleep(0.2)

if not sock_path.exists():
if not is_socket_available:
raise TimeoutError()

@staticmethod
Expand Down
Loading