summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-08 19:59:01 +0000
committerGerrit Code Review <review@openstack.org>2019-03-08 19:59:01 +0000
commitd4ce448583d8ed0d309d211a32637d72fe540bd3 (patch)
tree352a491590ca76850e6d2df1c885700e7a9808c7
parentb42087de2692d7db96f83e5f89153ab0c84bf3fa (diff)
parent3807db1b6ebc8d65ddc64f450d933fab2121e7eb (diff)
Merge "Fail wait when no resources found"
-rw-r--r--armada/handlers/wait.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/armada/handlers/wait.py b/armada/handlers/wait.py
index 721d6a1..f6e46eb 100644
--- a/armada/handlers/wait.py
+++ b/armada/handlers/wait.py
@@ -216,22 +216,22 @@ class ResourceWait(ABC):
216 216
217 timed_out, modified, unready, found_resources = ( 217 timed_out, modified, unready, found_resources = (
218 self._watch_resource_completions(timeout=deadline_remaining)) 218 self._watch_resource_completions(timeout=deadline_remaining))
219 if not found_resources: 219
220 if self.skip_if_none_found: 220 if (not found_resources) and self.skip_if_none_found:
221 return 221 return
222
223 if timed_out:
224 if not found_resources:
225 details = ('None found! Are `wait.labels` correct? Does '
226 '`wait.resources` need to exclude %s?'.format(
227 self.resource_type))
222 else: 228 else:
223 LOG.warn( 229 details = ('These {}s were not ready={}'.format(
224 'Saw no resources for ' 230 self.resource_type, sorted(unready)))
225 'resource type=%s, namespace=%s, labels=(%s). Are the ' 231 error = (
226 'labels correct?', self.resource_type, 232 'Timed out waiting for {}s (namespace={}, labels=({})). {}'
227 self.chart_wait.namespace, self.label_selector) 233 .format(self.resource_type, self.chart_wait.namespace,
228 234 self.label_selector, details))
229 # TODO(seaneagan): Should probably fail here even when resources
230 # were not found, at least once we have an option to ignore
231 # wait timeouts.
232 if timed_out and found_resources:
233 error = "Timed out waiting for resources={}".format(
234 sorted(unready))
235 LOG.error(error) 235 LOG.error(error)
236 raise k8s_exceptions.KubernetesWatchTimeoutException(error) 236 raise k8s_exceptions.KubernetesWatchTimeoutException(error)
237 237