From 8c3db31e35e673d3dbb4efb70c11bbeedc7cc31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 13 Nov 2019 17:42:29 +0100 Subject: [PATCH] ceph: update lvm filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following commit from LVM https://github.com/lvmteam/lvm2/commit/08396b4bce45fb8311979250623f04ec0ddb628c#diff-13c602a6258e57ce666a240e67c44f38 updated the lvm.conf and thus changed our filter. So now it does not match anymore. Updating the filter to match fixes that issue. Signed-off-by: Sébastien Han --- pkg/daemon/ceph/osd/volume.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/daemon/ceph/osd/volume.go b/pkg/daemon/ceph/osd/volume.go index 7b102a92d..65d455f42 100644 --- a/pkg/daemon/ceph/osd/volume.go +++ b/pkg/daemon/ceph/osd/volume.go @@ -155,7 +155,11 @@ func updateLVMConfig(context *clusterd.Context, onPVC bool) error { output = bytes.Replace(output, []byte(`scan = [ "/dev" ]`), []byte(`scan = [ "/dev", "/mnt" ]`), 1) // Only filter blocks in /mnt, when running on PVC we copy the PVC claim path to /mnt // And reject everything else + // We have 2 different regex depending on the version of LVM present in the container... + // Since https://github.com/lvmteam/lvm2/commit/08396b4bce45fb8311979250623f04ec0ddb628c#diff-13c602a6258e57ce666a240e67c44f38 + // the content changed, so depending which version is installled one of the two replace will work output = bytes.Replace(output, []byte(`# filter = [ "a|.*/|" ]`), []byte(`filter = [ "a|^/mnt/.*|", "r|.*|" ]`), 1) + output = bytes.Replace(output, []byte(`# filter = [ "a|.*|" ]`), []byte(`filter = [ "a|^/mnt/.*|", "r|.*|" ]`), 1) } if err = ioutil.WriteFile(lvmConfPath, output, 0644); err != nil {