Respect ErrorResults returned from preflight checks #386
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A common pattern in our operators is to use preflight checks to call out to some external system for more information (that can be written e.g. to the status of the
DeclarativeObject
) or to validate that some property of thespec
meets requirements to be able to expand the channel manifests. If the check fails, sometimes the right behavior is to requeue with backoff - butoften it's not: e.g., if the spec is deemed invalid, there's no reason to requeue the resource. If spec changes we'll get a new event anyway, and until spec changes we won't be able to reconcile.
There is already a
ErrorResult
type that can be used in a Preflight implementation to signal what we want the reconciliation function to return, but it's currently not being respected. This change addresses that.Which issue(s) this PR fixes:
Fixes #374