From fa928c67e5ba99e497caad7886e13abd42c47488 Mon Sep 17 00:00:00 2001 From: Martin Marcher Date: Wed, 8 May 2024 12:33:04 +0000 Subject: [PATCH] fix: handle null value for podData in DeployOdsComponent --- .../ods/orchestration/phases/DeployOdsComponent.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/ods/orchestration/phases/DeployOdsComponent.groovy b/src/org/ods/orchestration/phases/DeployOdsComponent.groovy index 89eac0d8d..675fc5912 100644 --- a/src/org/ods/orchestration/phases/DeployOdsComponent.groovy +++ b/src/org/ods/orchestration/phases/DeployOdsComponent.groovy @@ -59,7 +59,7 @@ class DeployOdsComponent { applyTemplates(openShiftDir, deploymentMean) def retries = project.environmentConfig?.openshiftRolloutTimeoutRetries ?: 10 - def podData = [] + def podData = null for (def i = 0; i < retries; i++) { podData = os.checkForPodData(project.targetProject, deploymentMean.selector) if (podData) { @@ -67,7 +67,11 @@ class DeployOdsComponent { } steps.echo("Could not find 'running' pod(s) with label '${deploymentMean.selector}' - waiting") steps.sleep(12) - } + } + + if podData == null { + throw new RuntimeException("Error: Could not find 'running' pod(s) with label '${deploymentMean.selector}'") + } // TODO: What if podData is empty? // TODO: Once the orchestration pipeline can deal with multiple replicas,