pool: add timeout to rbd cmd

Signed-off-by: zhucan <zhucan.k8s@gmail.com>
This commit is contained in:
zhucan committed 2022-09-16 10:26:20 +08:00
1 parent cb73f728cf
commit aa41742c83
1 file changed
+2 -1
+2 -1
View File
@@ -25,6 +25,7 @@ import (
"github.com/coreos/pkg/capnslog"
cephclient "github.com/rook/rook/pkg/daemon/ceph/client"
"github.com/rook/rook/pkg/util/exec"
"github.com/pkg/errors"
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
@@ -390,7 +391,7 @@ func createPool(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo,
}
logger.Infof("initializing pool %q for RBD use", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).RunWithTimeout(exec.CephCommandsTimeout)
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q for RBD use. %s", p.Name, string(output))
}