Skip to content

Commit

Permalink
Merge pull request #637 from luomingmeng/dev/fix-spd-indicator-updater
Browse files Browse the repository at this point in the history
Compatible with spd with empty scope
  • Loading branch information
luomingmeng authored Jun 27, 2024
2 parents d8ecbb3 + d8cf8dc commit 195c5c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/spd/spd_indicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ func (sc *SPDController) mergeIndicatorStatus(spd *apiworkload.ServiceProfileDes
}

for i := 0; i < len(spd.Status.AggMetrics); i++ {
// todo skip merge metrics when scope is empty(legacy), it will be removed in the future
if spd.Status.AggMetrics[i].Scope == "" {
continue
}

if _, ok := sc.indicatorsStatusAggMetrics[spd.Status.AggMetrics[i].Scope]; !ok {
klog.Infof("skip status metrics %v for spd %v", spd.Status.AggMetrics[i].Scope, spd.Name)
spd.Status.AggMetrics = append(spd.Status.AggMetrics[:i], spd.Status.AggMetrics[i+1:]...)
Expand Down

0 comments on commit 195c5c2

Please sign in to comment.