Skip to content

Commit

Permalink
Track info.Err in the status field
Browse files Browse the repository at this point in the history
This allows the reconcilation errors such as errors encountered in the
object transformers to be tracked in the field `status.errors`.
  • Loading branch information
haiyanmeng committed May 31, 2024
1 parent 83bd9c0 commit 82c15b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/patterns/addon/pkg/status/kstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ func (k *kstatusAggregator) BuildStatus(ctx context.Context, info *declarative.S

shouldComputeHealthFromObjects := info.Manifest != nil && info.LiveObjects != nil
if info.Err != nil {
isNewError := true
for _, err := range currentStatus.Errors {
if err == info.Err.Error() {
isNewError = false
}
}
if isNewError {
currentStatus.Errors = append(currentStatus.Errors, info.Err.Error())
}
switch info.KnownError {
case declarative.KnownErrorApplyFailed:
currentStatus.Phase = "Applying"
Expand Down

0 comments on commit 82c15b0

Please sign in to comment.