diff --git a/src/org/ods/component/HelmDeploymentStrategy.groovy b/src/org/ods/component/HelmDeploymentStrategy.groovy index 9194defce..42cd6b622 100644 --- a/src/org/ods/component/HelmDeploymentStrategy.groovy +++ b/src/org/ods/component/HelmDeploymentStrategy.groovy @@ -226,7 +226,7 @@ class HelmDeploymentStrategy extends AbstractDeploymentStrategy { resourceNames.each { resourceName -> def podData = [:] - podData = openShift.checkForPodData(context.targetProject, options.selector) + podData = openShift.checkForPodData(context.targetProject, options.selector, resourceName) context.addDeploymentToArtifactURIs("${resourceName}-deploymentMean", [ 'type': 'helm', diff --git a/src/org/ods/services/OpenShiftService.groovy b/src/org/ods/services/OpenShiftService.groovy index 8bf54eae2..90909e666 100644 --- a/src/org/ods/services/OpenShiftService.groovy +++ b/src/org/ods/services/OpenShiftService.groovy @@ -1024,7 +1024,7 @@ class OpenShiftService { // checkForPodData returns a subset of information from every pod, once // all pods matching the label are "running". If this is not the case, // it returns an empty list. - List checkForPodData(String project, String label) { + List checkForPodData(String project, String label, String resourceName=null) { List pods = [] def stdout = steps.sh( script: "oc -n ${project} get pod -l ${label} -o json", @@ -1033,7 +1033,11 @@ class OpenShiftService { ).toString().trim() def podJson = new JsonSlurperClassic().parseText(stdout) if (podJson && podJson.items.collect { it.status?.phase?.toLowerCase() }.every { it == 'running' }) { - pods = extractPodData(podJson) + if (podJson && resourceName && podJson.items.collect { it.metadata.name }.every { it.startsWith(resourceName) }) { + pods = extractPodData(podJson) + }else{ + pods = extractPodData(podJson) + } } pods }