controllers: only handle BuildError
All other errors returned by `build*` are already properly wrapped. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
eb0a554561
commit
fb45032eb6
|
|
@ -368,15 +368,14 @@ func (r *HelmChartReconciler) reconcileSource(ctx context.Context, obj *sourcev1
|
||||||
|
|
||||||
// Handle any build error
|
// Handle any build error
|
||||||
if retErr != nil {
|
if retErr != nil {
|
||||||
e := fmt.Errorf("failed to build chart from source artifact: %w", retErr)
|
if buildErr := new(chart.BuildError); errors.As(retErr, &buildErr) {
|
||||||
retErr = &serror.Event{
|
retErr = &serror.Event{
|
||||||
Err: e,
|
Err: buildErr,
|
||||||
Reason: meta.FailedReason,
|
Reason: buildErr.Reason.Reason,
|
||||||
}
|
}
|
||||||
if buildErr := new(chart.BuildError); errors.As(e, &buildErr) {
|
|
||||||
if chart.IsPersistentBuildErrorReason(buildErr.Reason) {
|
if chart.IsPersistentBuildErrorReason(buildErr.Reason) {
|
||||||
retErr = &serror.Stalling{
|
retErr = &serror.Stalling{
|
||||||
Err: e,
|
Err: buildErr,
|
||||||
Reason: buildErr.Reason.Reason,
|
Reason: buildErr.Reason.Reason,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue