From d9989171700260db5f97b609a0103e9268a8f290 Mon Sep 17 00:00:00 2001 From: Viktor Kram <92625690+ViktorKram@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:27:28 +0300 Subject: [PATCH] [controller] Fix a block device extension (#75) Signed-off-by: Viktor Kramarenko --- .../pkg/controller/lvm_volume_group_watcher_func.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/images/agent/pkg/controller/lvm_volume_group_watcher_func.go b/images/agent/pkg/controller/lvm_volume_group_watcher_func.go index a4e5bb4d..cd3eca9a 100644 --- a/images/agent/pkg/controller/lvm_volume_group_watcher_func.go +++ b/images/agent/pkg/controller/lvm_volume_group_watcher_func.go @@ -84,6 +84,15 @@ func shouldReconcileUpdateEvent(log logger.Logger, oldLVG, newLVG *v1alpha1.LvmV return true } + for _, n := range newLVG.Status.Nodes { + for _, d := range n.Devices { + if !utils.AreSizesEqualWithinDelta(d.PVSize, d.DevSize, internal.ResizeDelta) { + log.Debug(fmt.Sprintf("[shouldLVGWatcherReconcileUpdateEvent] update event should be reconciled as the LVMVolumeGroup %s PV size is different to device size", newLVG.Name)) + return true + } + } + } + return false }