From 0103881b0c961893d366973fea079c6e3ea31991 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 15 Feb 2022 16:56:33 +0530 Subject: [PATCH] fix: updates lvmvolumegroupnodestatus for vg Fixes a bug where the lvmvolumegroupnodestatus was not updated correctly for an existing VG. When adding a new device and restarting the vg-manager pod, the device is added to the LVM VG but is not updated in the lvmvolumegroupnodestatus or the LVMCluster status. Signed-off-by: N Balachandran --- pkg/vgmanager/vgmanager_controller.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/vgmanager/vgmanager_controller.go b/pkg/vgmanager/vgmanager_controller.go index 67bb65876..dc9018bae 100644 --- a/pkg/vgmanager/vgmanager_controller.go +++ b/pkg/vgmanager/vgmanager_controller.go @@ -318,12 +318,10 @@ func setStatus(status *lvmv1alpha1.VGStatus, instance *lvmv1alpha1.LVMVolumeGrou found := false vgStatuses := instance.Spec.LVMVGStatus - for _, vgStatus := range vgStatuses { + for i, vgStatus := range vgStatuses { if vgStatus.Name == status.Name { found = true - vgStatus.Status = status.Status - vgStatus.Reason = status.Reason - vgStatus.Devices = status.Devices + vgStatuses[i] = *status break } }