From f673e18441731e30dae38c476114fdefbd7c63dc Mon Sep 17 00:00:00 2001 From: Elio Bischof Date: Fri, 14 Oct 2022 16:51:24 +0200 Subject: [PATCH] fix: replace machines --- internal/operator/orbiter/kinds/providers/cs/machine.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/operator/orbiter/kinds/providers/cs/machine.go b/internal/operator/orbiter/kinds/providers/cs/machine.go index 28f98a48f..e66ca9006 100644 --- a/internal/operator/orbiter/kinds/providers/cs/machine.go +++ b/internal/operator/orbiter/kinds/providers/cs/machine.go @@ -93,13 +93,14 @@ func (m *machine) initAction(a *action, getSlice func() []string, setSlice func( if newAction.required { newAction.unrequire = func() { s := getSlice() + var withoutThisMachine []string for sIdx := range s { req := s[sIdx] - if req == m.ID() { - s = append(s[0:sIdx], s[sIdx+1:]...) + if req != m.ID() { + withoutThisMachine = append(withoutThisMachine, req) } } - setSlice(s) + setSlice(withoutThisMachine) } }