ceph: fix hostpath of osd to avoid data corruption

A directory is created under dataDirHostPath for each OSD. In host-based cluster,
its name is constructed from kernel device name like _dev_sdb though user specifies
udev persistent device name. We should use unique name among all OSDs.

Closes: https://github.com/rook/rook/issues/7878

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
This commit is contained in:
Satoru Takeuchi
2021-05-12 01:31:46 +00:00
parent 4f63e88ad5
commit 6af014b798
+1 -2
View File
@@ -22,7 +22,6 @@ import (
"path"
"path/filepath"
"strconv"
"strings"
"github.com/libopenstorage/secrets"
"github.com/pkg/errors"
@@ -738,7 +737,7 @@ func (c *Cluster) getActivateOSDInitContainer(configDir, namespace, osdID string
Path: filepath.Join(
configDir,
namespace,
strings.ReplaceAll(osdInfo.BlockPath, "/", "_"),
c.clusterInfo.FSID+"_"+osdInfo.UUID,
),
Type: &hostPathType,
},