OCI HelmRepo: handle status conditions in-line #748
Merged
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.
Refactor the OCI HelmRepo reconciler to remove extra custom status
conditions and manage Ready, Reconciling and Stalled conditions within
the reconciler, in-line.
Since OCI HelmRepository is a simple reconciler, it'd be better
to not introduce extra conditions and utilize the three base conditions
to represent the status. In order to have consistent status conditions,
a new summarization code is written within the reconciler based
on the context. It takes into consideration a lot of the details from
the internal/reconcile/summarize package and handles certain scenarios
in context specific manner. All the result and error abstractions are
removed since they are only needed when using internal/reconcile
package.
Some of the code patterns introduced in this can be moved into separate
functions and tested individually, similar to the helpers in the internal/reconcile/
package. It can also be integrated into the summarize and patch helpers.
It can be done separately as a follow-up.
Refer https://gist.github.com/darkowlzz/c5c86afb148ad06dc7c4cc8c6afcdaef
for examples of how the status conditions appear in various scenarios.
Examples of the events:
NOTE: Some of the strings may be different in the code. This snapshot was taken during development.
Supersedes #733