From 424b697612e06b2fcdd919196d20e091c02a03d5 Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Thu, 1 Sep 2022 16:30:07 +0200 Subject: [PATCH] fix objects copy --- pkg/steering/controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/steering/controller.go b/pkg/steering/controller.go index 54e8b0a..8a16c71 100644 --- a/pkg/steering/controller.go +++ b/pkg/steering/controller.go @@ -201,7 +201,9 @@ func (c *Controller) Objects() []*events.Object { c.muObjects.RLock() defer c.muObjects.RUnlock() res := make([]*events.Object, 0, len(c.objects)) - copy(res, c.objects) + for _, o := range c.objects { + res = append(res, o) + } zap.S().Debugf("copy object from %v to %v", c.objects, res) return res }