Name the instance where disks are already attached to, which is not
necessarily the instance where we want to attach a disk to.
This fixes issue 1151.
Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Oleg Ponomarev <oponomarev@google.com>
let insts = M.elems . fromContainer . configInstances . csConfigData $ cs
forM_ insts (\inst' -> when (uuidDisk `elem` instDisks inst') . Bad
. ReservationError $ printf "Disk %s already attached to instance %s"
- uuidDisk (show . fromMaybe "" $ instName inst))
+ uuidDisk (show . fromMaybe "" $ instName inst'))
-- * Pure config modifications functions