summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Eagan <sean.eagan@att.com>2019-03-01 14:24:13 -0600
committerSean Eagan <sean.eagan@att.com>2019-03-01 17:41:50 -0600
commit3807db1b6ebc8d65ddc64f450d933fab2121e7eb (patch)
tree65d82807c66019dc3c0d06c2198c77735557a6ee
parente7c7a86f48f0403a81f2cf78b656a92be3d47874 (diff)
Fail wait when no resources found
This removees a fail-safe that allowed releases which did not contain pods (intentionally) to still succeed after a best effort to wait for them until timeout. Now that we have the ability to disable waiting on resource types `wait.resources` [0], this fail-safe is no longer needed. Now when resources are not found, armada will fail with a message for the user to check their `wait.resources` and labels and configure as needed. This way we can prompt the user to remove unnecessary waiting from their deployments. There is also a longer term plan to make these configurations less often needed [1]. [0]: https://review.openstack.org/#/c/603901/ [1]: https://review.openstack.org/#/c/636440/ Change-Id: I859326470ecba49f2301705409c51312a601e653
Notes
Notes (review): Code-Review+1: Vladyslav Drok <vdrok@mirantis.com> Code-Review+1: Ahmad Mahmoudi <am495p@att.com> Code-Review+1: Nishant Kumar <nishant.e.kumar@ericsson.com> Code-Review+1: Dan Crank <dan.no@att.com> Code-Review+1: Michael Beaver <michaelbeaver64@gmail.com> Code-Review+2: Scott Hussey <sthussey@att.com> Code-Review+2: Drew Walters <drewwalters96@gmail.com> Workflow+1: Drew Walters <drewwalters96@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 08 Mar 2019 19:59:01 +0000 Reviewed-on: https://review.openstack.org/640511 Project: openstack/airship-armada Branch: refs/heads/master
-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