Skip to content

Commit

Permalink
fix invalid update branching
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Nov 15, 2024
1 parent 8cee2bd commit 8460a3f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions operators/endpointmetrics/pkg/collector/metrics_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ func (m *MetricsCollector) Update(ctx context.Context, req ctrl.Request) error {
m.reportStatus(ctx, status.MetricsCollector, status.UpdateFailed, "Failed to update metrics collector")
return err
} else {
if m.ObsAddon.Spec.EnableMetrics && m.platformCollectorWasUpdated {
m.reportStatus(ctx, status.MetricsCollector, status.UpdateSuccessful, "Metrics collector updated")
if m.ObsAddon.Spec.EnableMetrics {
if m.platformCollectorWasUpdated {
m.reportStatus(ctx, status.MetricsCollector, status.UpdateSuccessful, "Metrics collector updated")
}
} else {
m.reportStatus(ctx, status.MetricsCollector, status.Disabled, "Metrics collector disabled")
}
Expand All @@ -131,8 +133,10 @@ func (m *MetricsCollector) Update(ctx context.Context, req ctrl.Request) error {
m.reportStatus(ctx, status.UwlMetricsCollector, status.UpdateFailed, "Failed to update UWL Metrics collector")
return err
} else {
if m.ObsAddon.Spec.EnableMetrics && m.userWorkloadCollectorWasUpdated {
m.reportStatus(ctx, status.UwlMetricsCollector, status.UpdateSuccessful, "UWL Metrics collector updated")
if m.ObsAddon.Spec.EnableMetrics {
if m.userWorkloadCollectorWasUpdated {
m.reportStatus(ctx, status.UwlMetricsCollector, status.UpdateSuccessful, "UWL Metrics collector updated")
}
} else {
m.reportStatus(ctx, status.UwlMetricsCollector, status.Disabled, "UWL Metrics collector disabled")
}
Expand Down

0 comments on commit 8460a3f

Please sign in to comment.