Skip to content

Commit

Permalink
Compatible with spd with empty scope
Browse files Browse the repository at this point in the history
  • Loading branch information
luomingmeng committed Jun 26, 2024
1 parent 4858a44 commit d8cf8dc
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 d8cf8dc

Please sign in to comment.