Skip to content

Commit d7a278a

Browse files
authored
reset status.healthy in each reconcile (kubernetes-sigs#318)
* reset status.healthy in each reconcile * simpler status.healthy
1 parent 1470d8f commit d7a278a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func (k *kstatusAggregator) BuildStatus(ctx context.Context, info *declarative.S
3030

3131
shouldComputeHealthFromObjects := info.Manifest != nil && info.LiveObjects != nil
3232
if info.Err != nil {
33-
currentStatus.Healthy = false
3433
switch info.KnownError {
3534
case declarative.KnownErrorApplyFailed:
3635
currentStatus.Phase = "Applying"
@@ -88,7 +87,7 @@ func (k *kstatusAggregator) BuildStatus(ctx context.Context, info *declarative.S
8887
}
8988
currentStatus.Phase = string(aggregatedPhase)
9089
}
91-
90+
currentStatus.Healthy = currentStatus.Phase == string(status.CurrentStatus)
9291
if err := utils.SetCommonStatus(info.Subject, currentStatus); err != nil {
9392
return err
9493
}

0 commit comments

Comments
 (0)