Skip to content

Commit a08a9c8

Browse files
authored
[patch] Increase timeout for pvc bind wait (#157)
1 parent e93c898 commit a08a9c8

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/mas/devops/ocp.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,12 @@ def listInstances(dynClient: DynamicClient, apiVersion: str, kind: str) -> list:
259259

260260

261261
def waitForPVC(dynClient: DynamicClient, namespace: str, pvcName: str) -> bool:
262+
"""
263+
We will allow up to 10 minutes for a PVC to report a successful binding
264+
"""
262265
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
263-
maxRetries = 60
266+
maxRetries = 20
267+
retryDelaySeconds = 30
264268
foundReadyPVC = False
265269
retries = 0
266270
while not foundReadyPVC and retries < maxRetries:
@@ -270,11 +274,11 @@ def waitForPVC(dynClient: DynamicClient, namespace: str, pvcName: str) -> bool:
270274
if pvc.status.phase == "Bound":
271275
foundReadyPVC = True
272276
else:
273-
logger.debug(f"Waiting 5s for PVC {pvcName} to be ready before checking again ...")
274-
sleep(5)
277+
logger.debug(f"Waiting {retryDelaySeconds}s for PVC {pvcName} to be bound before checking again ...")
278+
sleep(retryDelaySeconds)
275279
except NotFoundError:
276-
logger.debug(f"Waiting 5s for PVC {pvcName} to be created before checking again ...")
277-
sleep(5)
280+
logger.debug(f"Waiting {retryDelaySeconds}s for PVC {pvcName} to be created before checking again ...")
281+
sleep(retryDelaySeconds)
278282

279283
return foundReadyPVC
280284

0 commit comments

Comments
 (0)