Skip to content

Commit 5b1d19b

Browse files
authored
fix(vm): preserve spec.blockDeviceRefs order in hotplug handler (#2360)
Iterate over Spec.BlockDeviceRefs slice instead of map when hotplugging to preserve hotplug order. Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
1 parent 67b70fa commit 5b1d19b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

images/virtualization-artifact/pkg/controller/vm/internal/hotplug_handler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func (h *HotplugHandler) Handle(ctx context.Context, s state.VirtualMachineState
9494
var errs []error
9595

9696
// 1. Hotplugging
97-
for key := range specDevices {
97+
for _, bd := range current.Spec.BlockDeviceRefs {
98+
key := nameKindKey{kind: bd.Kind, name: bd.Name}
9899
volName := generateVolumeName(key)
99100
if _, onKVVM := kvvmDevices[key]; onKVVM {
100101
continue

0 commit comments

Comments
 (0)