Skip to content

Commit 82c15b0

Browse files
committed
Track info.Err in the status field
This allows the reconcilation errors such as errors encountered in the object transformers to be tracked in the field `status.errors`.
1 parent 83bd9c0 commit 82c15b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/patterns/addon/pkg/status/kstatus.go

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ func (k *kstatusAggregator) BuildStatus(ctx context.Context, info *declarative.S
8888

8989
shouldComputeHealthFromObjects := info.Manifest != nil && info.LiveObjects != nil
9090
if info.Err != nil {
91+
isNewError := true
92+
for _, err := range currentStatus.Errors {
93+
if err == info.Err.Error() {
94+
isNewError = false
95+
}
96+
}
97+
if isNewError {
98+
currentStatus.Errors = append(currentStatus.Errors, info.Err.Error())
99+
}
91100
switch info.KnownError {
92101
case declarative.KnownErrorApplyFailed:
93102
currentStatus.Phase = "Applying"

0 commit comments

Comments
 (0)