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
This commit is contained in:
parent
e7c7a86f48
commit
3807db1b6e
@ -216,22 +216,22 @@ class ResourceWait(ABC):
|
|||||||
|
|
||||||
timed_out, modified, unready, found_resources = (
|
timed_out, modified, unready, found_resources = (
|
||||||
self._watch_resource_completions(timeout=deadline_remaining))
|
self._watch_resource_completions(timeout=deadline_remaining))
|
||||||
if not found_resources:
|
|
||||||
if self.skip_if_none_found:
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
LOG.warn(
|
|
||||||
'Saw no resources for '
|
|
||||||
'resource type=%s, namespace=%s, labels=(%s). Are the '
|
|
||||||
'labels correct?', self.resource_type,
|
|
||||||
self.chart_wait.namespace, self.label_selector)
|
|
||||||
|
|
||||||
# TODO(seaneagan): Should probably fail here even when resources
|
if (not found_resources) and self.skip_if_none_found:
|
||||||
# were not found, at least once we have an option to ignore
|
return
|
||||||
# wait timeouts.
|
|
||||||
if timed_out and found_resources:
|
if timed_out:
|
||||||
error = "Timed out waiting for resources={}".format(
|
if not found_resources:
|
||||||
sorted(unready))
|
details = ('None found! Are `wait.labels` correct? Does '
|
||||||
|
'`wait.resources` need to exclude %s?'.format(
|
||||||
|
self.resource_type))
|
||||||
|
else:
|
||||||
|
details = ('These {}s were not ready={}'.format(
|
||||||
|
self.resource_type, sorted(unready)))
|
||||||
|
error = (
|
||||||
|
'Timed out waiting for {}s (namespace={}, labels=({})). {}'
|
||||||
|
.format(self.resource_type, self.chart_wait.namespace,
|
||||||
|
self.label_selector, details))
|
||||||
LOG.error(error)
|
LOG.error(error)
|
||||||
raise k8s_exceptions.KubernetesWatchTimeoutException(error)
|
raise k8s_exceptions.KubernetesWatchTimeoutException(error)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user