Skip to content

Commit

Permalink
fix: handle null value for podData in DeployOdsComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
serverhorror committed May 8, 2024
1 parent ce9fdde commit fa928c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/org/ods/orchestration/phases/DeployOdsComponent.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,19 @@ 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) {
return podData
}
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,
Expand Down

0 comments on commit fa928c6

Please sign in to comment.