Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph: initialize rbd block pool after creation #8923

Merged
merged 1 commit into from Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/operator/ceph/pool/controller.go
Expand Up @@ -356,6 +356,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}
travisn marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -51,6 +51,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