Avoid masking errors from generateSecretFromSource + reconcile SUR when generated repository is updated
There is a small issue in error handling that slipped in !368 (merged): errors from generateSecretFromSource should not be reported as transientError:
- The
transientError(sylvav1alpha1.ResourceNotReadyReason, "%s secret is not ready", vf.Type)is hiding the original error, making the resolution of such issues more complex since users won't know the root cause. - As explained in this comment, we don't need to requeue since we're watching source objects, so we shouldn't use a transient error.
First commit was proposing to change how these errors are hadled.
But e2e tests have shown that removing that transient error was causing failures, since SUR remained stuck on:
Reason: "ReconciliationFailed",
Message: "SylvaUnitsFile used in valuesFrom is not ready",
Since it's not requeuing any more while waiting for sylva-units source to become ready.
In order to overcome that issue, we add a specific case in the indexing function of the repositories watches (this is done in a second commit)
Finally, in the last commit, we improve the log and message of the above error to display:
SylvaUnitsFile git repository sylva-units-7fae4108 used in valuesFrom is not ready
Relates-to #52 (closed)
Edited by Thomas Morin