Skip to content

Commit b3b3889

Browse files
committed
Increase initial and default Podman socket timeout
Fixes: #336 Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
1 parent 80bcd46 commit b3b3889

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/gardenlinux/oci/podman.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,13 @@ def tag(
278278
:since: 1.0.0
279279
"""
280280

281-
oci_data = oci_container_tag.rsplit(":", 1)
281+
if ":" in oci_container_tag:
282+
oci_data = oci_container_tag.rsplit(":", 1)
282283

283-
if len(oci_data) < 2:
284-
raise RuntimeError("No tag given")
284+
if len(oci_data) < 2:
285+
raise RuntimeError("No tag given")
286+
else:
287+
oci_data = ( "", oci_container_tag )
285288

286289
image = podman.images.get(image_id)
287290
image.tag(oci_data[0], oci_data[1])

src/gardenlinux/oci/podman_context.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,19 @@ def _wait_for_socket(self, sock: str) -> None:
137137
:since: 1.0.0
138138
"""
139139

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

142-
for _ in range(0, 5 * PODMAN_CONNECTION_MAX_IDLE_SECONDS):
143-
if sock_path.exists():
144+
for _ in range(0, 50 * PODMAN_CONNECTION_MAX_IDLE_SECONDS):
145+
is_socket_available = sock_path.exists()
146+
147+
if is_socket_available:
144148
break
145149

146150
sleep(0.2)
147151

148-
if not sock_path.exists():
152+
if not is_socket_available:
149153
raise TimeoutError()
150154

151155
@staticmethod

0 commit comments

Comments
 (0)