Skip to content

Commit

Permalink
Merge pull request #8929 from rook/mergify/bp/release-1.7/pr-8923
Browse files Browse the repository at this point in the history
ceph: initialize rbd block pool after creation (backport #8923)
  • Loading branch information
mergify[bot] committed Oct 6, 2021
2 parents 82252d4 + f573b60 commit c7bfade
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/operator/ceph/pool/controller.go
Expand Up @@ -357,6 +357,14 @@ func createPool(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo,
return errors.Wrapf(err, "failed to create pool %q", p.Name)
}

logger.Infof("initializing pool %q", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
}
logger.Infof("successfully initialized pool %q", p.Name)

return nil
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/operator/ceph/pool/controller_test.go
Expand Up @@ -52,6 +52,9 @@ func TestCreatePool(t *testing.T) {
if command == "ceph" && args[1] == "erasure-code-profile" {
return `{"k":"2","m":"1","plugin":"jerasure","technique":"reed_sol_van"}`, nil
}
if command == "rbd" {
assert.Equal(t, []string{"pool", "init", "mypool"}, args[0:3])
}
return "", nil
},
}
Expand Down

0 comments on commit c7bfade

Please sign in to comment.