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

Rewrite BucketReconciler to new standards #412

Merged
merged 4 commits into from
Aug 11, 2021
Merged

Commits on Aug 10, 2021

  1. Rewrite BucketReconciler to new standards

    This commit rewrites the `BucketReconciler` to new standards, while
    implementing the newly introduced Condition types, and trying to
    adhere better to Kubernetes API conventions.
    
    More specifically it introduces:
    
    - Implementation of more explicit Condition types to highlight
      abnormalities.
    - Extensive usage of the `conditions` subpackage from `runtime`.
    - Better and more conflict-resilient (status)patching of reconciled
      objects using the `patch` subpackage from runtime.
    - Proper implementation of kstatus' `Reconciling` and `Stalled`
      conditions.
    - Refactor of reconciler logic, including more efficient detection of
      changes to bucket objects by making use of the etag data available,
      and downloading of object files in parallel with a limited number of
      workers (4).
    - Integration tests that solely rely on `testenv` and do not
      use Ginkgo.
    
    There are a couple of TODOs marked in-code, these are suggestions for
    the future and should be non-blocking.
    In addition to the TODOs, more complex and/or edge-case test scenarios
    may be added as well.
    
    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    588ccbf View commit details
    Browse the repository at this point in the history
  2. Consolidate condition types into FetchFailed

    This commit consolidates the `DownloadFailed` and `CheckoutFailed`
    Condition types into a new more generic `FetchFailed` type to simplify
    the API and observations by consumers.
    
    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    15bc9e7 View commit details
    Browse the repository at this point in the history
  3. BucketReconciler: Add reconcileArtifact tests

    Add `BucketReconciler.reconcileArtifact` tests based on
    `GitRepositoryReconciler.reconcileArtifact` test cases.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz authored and hiddeco committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    b49a809 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2021

  1. Wrap err with context instead of logging twice

    This wraps the errors which are returned instead of logging them, as
    the returned error is logged at the end of the reconcile run.
    
    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Aug 11, 2021
    Configuration menu
    Copy the full SHA
    29f207d View commit details
    Browse the repository at this point in the history