Rewrite BucketReconciler to new standards#412
Merged
hiddeco merged 4 commits intoreconcilers-devfrom Aug 11, 2021
Merged
Conversation
ca456d3 to
cd886e3
Compare
BucketReconcilers to new standardsBucketReconciler to new standards
cd886e3 to
4b82782
Compare
5 tasks
cb7b730 to
3123992
Compare
hiddeco
commented
Aug 6, 2021
hiddeco
commented
Aug 6, 2021
darkowlzz
reviewed
Aug 9, 2021
| }, timeout).Should(BeTrue()) | ||
| } | ||
|
|
||
| func TestBucketReconciler_reconcileStorage(t *testing.T) { |
Contributor
There was a problem hiding this comment.
reconcileStorage() implementations for bucket and gitrepository reconcilers seem to be exactly the same. Should we have a common function with this one test? Currently there's no test for reconcileStorage in gitrepository reconciler.
Member
Author
There was a problem hiding this comment.
I had noticed this too, but not taken the time yet to think about how I wanted to factor it out. The same goes for garbageCollect by the way.
8bc86ba to
4338305
Compare
souleb
reviewed
Aug 9, 2021
4338305 to
0d2ae53
Compare
75f555c to
20bf5da
Compare
0016698 to
8e2fdec
Compare
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>
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>
Add `BucketReconciler.reconcileArtifact` tests based on `GitRepositoryReconciler.reconcileArtifact` test cases. Signed-off-by: Sunny <darkowlzz@protonmail.com>
8e2fdec to
3f2fcf3
Compare
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>
3f2fcf3 to
29f207d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supersedes #361
This PR rewrites the
BucketReconcilerto new standards, whileimplementing the newly introduced Condition types, and trying to
adhere better to Kubernetes API conventions.
More specifically it introduces:
abnormalities.
conditionssubpackage fromruntime.objects using the
patchsubpackage from runtime.ReconcilingandStalledconditions.
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).
testenvand do notuse 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.