Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Backoff-based error policy #314

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Aug 30, 2020

  1. Add Backoff-based error policy

    This also has some side effects with breaking changes. Notably:
    
    1. `error_policy` is now told about successful reconciliations. This is
    required so that stateful error policies can reset upon successes.
    
    2. `error_policy` is now told the reference to the reconciled object.
    
    3. `controller::Error` is now keyed by the object type. This isn't strictly
    required, but allows for some internal cleanup.
    
    4. `Controller::run` takes a `Backoff` factory rather than a raw `error_policy`.
    This provides a much cleaner interface for custom policies, and the `backoff`
    crate provides both constant and exponential policies. If you need the extra
    control that the old interface provided, use the "hard-mode"
    `controller::applier` API.
    nightkr committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    18c73f5 View commit details
    Browse the repository at this point in the history
  2. Make error_policy into a proper trait

    The signature was getting unwieldy, and with the recent changes it was hard to
    know whether all instances had "kept up".
    
    This also gets rid of the weirdness where `error_policy` could rewrite the
    `ReconcilerAction` of a successful reconciliation.
    nightkr committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    8a1c4ca View commit details
    Browse the repository at this point in the history
  3. Fix controller doctest

    nightkr committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    ba8e84c View commit details
    Browse the repository at this point in the history