nvmeof: set nvmeof-meta application tag on .nvmeof pool

the .nvmeof pool was incorrectly tagged with the rbd
application and initialized as an rbd pool. add .nvmeof
to the built-in pool switch so it gets the nvmeof-meta
application tag instead, and skip rbd pool init.

Signed-off-by: Oded Viner <oviner@redhat.com>
This commit is contained in:
Oded Viner committed 2026-07-24 18:11:37 +03:00
1 parent 6fec883e62
commit f095a530c8
2 files changed
+19 -3

No files matched your search

+2
View File
@@ -200,6 +200,8 @@ func CreatePoolWithPGs(context *clusterd.Context, clusterInfo *ClusterInfo, clus
pool.Application = "nfs"
case ".rgw.root":
pool.Application = "rgw"
case ".nvmeof":
pool.Application = "nvmeof-meta"
}
if pool.IsReplicated() {
+17 -3
View File
@@ -50,6 +50,7 @@ func TestCreatePool(t *testing.T) {
p := &cephv1.NamedPoolSpec{}
enabledMetricsApp := false
enabledMgrApp := false
enabledNvmeofApp := false
clusterInfo := cephclient.AdminTestClusterInfo("mycluster")
executor := &exectest.MockExecutor{
MockExecuteCommandWithTimeout: func(timeout time.Duration, command string, args ...string) (string, error) {
@@ -76,11 +77,14 @@ func TestCreatePool(t *testing.T) {
}
assert.Equal(t, "enable", args[3])
if args[5] != "rbd" {
if args[4] == ".mgr" {
switch args[4] {
case ".mgr":
enabledMgrApp = true
assert.Equal(t, ".mgr", args[4])
assert.Equal(t, "mgr", args[5])
} else {
case ".nvmeof":
enabledNvmeofApp = true
assert.Equal(t, "nvmeof-meta", args[5])
default:
fmt.Printf("pool - %v", args)
assert.Fail(t, fmt.Sprintf("invalid pool %q", args[4]))
}
@@ -122,6 +126,16 @@ func TestCreatePool(t *testing.T) {
assert.True(t, enabledMgrApp)
})
t.Run("built-in nvmeof pool", func(t *testing.T) {
p.Name = ".nvmeof"
p.Replicated.Size = 1
p.Replicated.RequireSafeReplicaSize = false
p.Application = ""
err := createPool(context, clusterInfo, clusterSpec, p)
assert.Nil(t, err)
assert.True(t, enabledNvmeofApp)
})
t.Run("ec pool", func(t *testing.T) {
p.Name = "ecpool"
p.Replicated.Size = 0