Skip to content
Merged
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
14 changes: 9 additions & 5 deletions src/mas/devops/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ def listInstances(dynClient: DynamicClient, apiVersion: str, kind: str) -> list:


def waitForPVC(dynClient: DynamicClient, namespace: str, pvcName: str) -> bool:
"""
We will allow up to 10 minutes for a PVC to report a successful binding
"""
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
maxRetries = 60
maxRetries = 20
retryDelaySeconds = 30
foundReadyPVC = False
retries = 0
while not foundReadyPVC and retries < maxRetries:
Expand All @@ -270,11 +274,11 @@ def waitForPVC(dynClient: DynamicClient, namespace: str, pvcName: str) -> bool:
if pvc.status.phase == "Bound":
foundReadyPVC = True
else:
logger.debug(f"Waiting 5s for PVC {pvcName} to be ready before checking again ...")
sleep(5)
logger.debug(f"Waiting {retryDelaySeconds}s for PVC {pvcName} to be bound before checking again ...")
sleep(retryDelaySeconds)
except NotFoundError:
logger.debug(f"Waiting 5s for PVC {pvcName} to be created before checking again ...")
sleep(5)
logger.debug(f"Waiting {retryDelaySeconds}s for PVC {pvcName} to be created before checking again ...")
sleep(retryDelaySeconds)

return foundReadyPVC

Expand Down