From 3348eae6e139308391230b4599b4e2b36e58b546 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 29 Oct 2021 14:06:45 +0000 Subject: [PATCH] chore: add size to map initialisation in convert.go --- infrastructure/grpc/convert.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure/grpc/convert.go b/infrastructure/grpc/convert.go index 225bab18..fb172482 100644 --- a/infrastructure/grpc/convert.go +++ b/infrastructure/grpc/convert.go @@ -197,7 +197,7 @@ func convertModelToMicroVMStatus(mvm *models.MicroVM) *types.MicroVMStatus { converted.State = types.MicroVMStatus_FAILED } - converted.Volumes = make(map[string]*types.VolumeStatus) + converted.Volumes = make(map[string]*types.VolumeStatus, len(mvm.Status.Volumes)) for volName, volStatus := range mvm.Status.Volumes { converted.Volumes[volName] = convertModelToVolumeStatus(volStatus) } @@ -210,7 +210,7 @@ func convertModelToMicroVMStatus(mvm *models.MicroVM) *types.MicroVMStatus { converted.InitrdMount = convertModelToVolumeMount(mvm.Status.InitrdMount) } - converted.NetworkInterfaces = make(map[string]*types.NetworkInterfaceStatus) + converted.NetworkInterfaces = make(map[string]*types.NetworkInterfaceStatus, len(mvm.Status.NetworkInterfaces)) for netIfaceName, netIfaceStatus := range mvm.Status.NetworkInterfaces { converted.NetworkInterfaces[netIfaceName] = convertModelToNetworkInterfaceStatus(netIfaceStatus) }