fix-test: ignore terminating registry pods in test-cmd.sh
@@ -129,7 +129,7 @@ os::cmd::expect_success 'oc env -n default dc/docker-registry REGISTRY_MIDDLEWAR
os::cmd::expect_success 'oc rollout status dc/docker-registry'
os::log::info "Restore configured to enable mirroring"
-registry_pod="$(oc get pod -n default -l deploymentconfig=docker-registry --template='{{(index .items 0).metadata.name}}')"
+registry_pod="$(oc get pod -n default -l deploymentconfig=docker-registry --template '{{range .items}}{{if not .metadata.deletionTimestamp}}{{.metadata.name}}{{end}}{{end}}')"
# Client setup (log in as e2e-user and set 'test' as the default project)
# This is required to be able to push to the registry!
@@ -583,7 +583,7 @@ os::cmd::expect_success "docker tag ${GCR_PAUSE_IMAGE} ${DOCKER_REGISTRY}/cache/
os::cmd::expect_success "docker push ${DOCKER_REGISTRY}/cache/prune"
# record the storage before pruning
-registry_pod=$(oc get pod -n default -l deploymentconfig=docker-registry --template='{{(index .items 0).metadata.name}}')
+registry_pod="$(oc get pod -n default -l deploymentconfig=docker-registry --template '{{range .items}}{{if not .metadata.metadata.deletionTimestamp}}{{.metadata.name}}{{end}}{{end}}')"
os::cmd::expect_success "oc exec -p ${registry_pod} du /registry > '${LOG_DIR}/prune-images.before.txt'"
# set up pruner user
