Skip to content

Commit

Permalink
fix: using iterator as value of pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
kubeJocker committed Oct 11, 2023
1 parent 0d269ed commit 59cc19f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controllers/monitor/reconcile/oteld.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ func OTeld(reqCtx monitortype.ReconcileCtx, params monitortype.OTeldParams) (err
return err
}
instanceMap, err := buildOteldInstance(datasources, oteldTemplates)
reqCtx.SetOteldInstanceMap(instanceMap)

for _, template := range oteldTemplates.Items {
instance := reqCtx.GetOteldInstance(template.Spec.Mode)
for i := 0; i < len(oteldTemplates.Items); i++ {
template := oteldTemplates.Items[i]
instance := instanceMap[template.Spec.Mode]
if instance == nil {
continue
}
instance.OteldTemplate = &template
}

reqCtx.SetOteldInstanceMap(instanceMap)
if err != nil {
return err
}
Expand Down

0 comments on commit 59cc19f

Please sign in to comment.