From 591fc5f68b8c597a17f7e765f298554bc2cc173f Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Tue, 13 Sep 2022 11:36:34 +0000 Subject: [PATCH] osd: disallow to create encrypted osd on partition Rook doesn't support encrypted osd on partition. So we should skip partitions as candidates of the new encrypted osds. Closes: https://github.com/rook/rook/issues/10911 Signed-off-by: Satoru Takeuchi --- pkg/daemon/ceph/osd/daemon.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/daemon/ceph/osd/daemon.go b/pkg/daemon/ceph/osd/daemon.go index 3419cd864..f48100072 100644 --- a/pkg/daemon/ceph/osd/daemon.go +++ b/pkg/daemon/ceph/osd/daemon.go @@ -435,6 +435,11 @@ func getAvailableDevices(context *clusterd.Context, agent *OsdAgent) (*DeviceOsd } logger.Infof("device %q is available.", device.Name) + if device.Type == sys.PartType && agent.storeConfig.EncryptedDevice { + logger.Infof("partition %q is not picked because encrypted OSD on partition is not allowed", device.Name) + continue + } + var deviceInfo *DeviceOsdIDEntry if agent.metadataDevice != "" && agent.metadataDevice == device.Name { // current device is desired as the metadata device