File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,13 @@ steps:
118
118
&az aks get-credentials --resource-group $(azureResourceGroup) --name $(kubernetesCluster)
119
119
# Get all running pods in the namespace
120
120
$content = &kubectl get pods -n pipeline-$(Build.BuildNumber) --field-selector=status.phase=Running 2>&1
121
- While ($content -like 'No resources found*')
121
+ # Ensure that this task does not run for more than about 90 seconds
122
+ $waitLimit = 90
123
+ $timeWaiting = 0
124
+ While (($content -like 'No resources found*') -and ($timeWaiting -lt $waitLimit))
122
125
{
123
126
start-sleep -Seconds 5
127
+ $timeWaiting = $timeWaiting + 5
124
128
$content = &kubectl get pods -n pipeline-$(Build.BuildNumber) --field-selector=status.phase=Running 2>&1
125
129
}
126
130
$content = &kubectl get pods -n pipeline-$(Build.BuildNumber) --field-selector=status.phase=Running -o jsonpath="{.items[0].metadata.name}"
@@ -148,9 +152,13 @@ steps:
148
152
&az aks get-credentials --resource-group $(azureResourceGroup) --name $(kubernetesCluster)
149
153
# Get ipAddress for service in namespace
150
154
$content = &kubectl get services -n pipeline-$(Build.BuildNumber) -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}"
151
- While ([String]::IsNullOrWhiteSpace($content))
155
+ # Ensure that this task does not run for more than about 90 seconds
156
+ $waitLimit = 90
157
+ $timeWaiting = 0
158
+ While ([String]::IsNullOrWhiteSpace($content) -and ($timeWaiting -lt $waitLimit))
152
159
{
153
160
start-sleep -Seconds 5
161
+ $timeWaiting = $timeWaiting + 5
154
162
$content = &kubectl get services -n pipeline-$(Build.BuildNumber) -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}"
155
163
}
156
164
$content = &kubectl get services -n pipeline-$(Build.BuildNumber) -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}"
You can’t perform that action at this time.
0 commit comments