From da01c8d4726b76bc0478255497dd055c6b0b6e7f Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Thu, 11 Jun 2020 11:12:04 +0200 Subject: [PATCH] fix expanding rbd volumes without ceph.conf Ignore stderr of rbd info --format=json as without a ceph.conf it will print messages about no configuration onto stderr which break the json parsing. The actual json information the function wants is always on stdout. Closes: gh-88643 Signed-off-by: Julian Taylor --- pkg/volume/rbd/rbd_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/volume/rbd/rbd_util.go b/pkg/volume/rbd/rbd_util.go index 1db829b50957..7fb7fcaaf9e4 100644 --- a/pkg/volume/rbd/rbd_util.go +++ b/pkg/volume/rbd/rbd_util.go @@ -712,7 +712,7 @@ func (util *rbdUtil) rbdInfo(b *rbdMounter) (int, error) { // klog.V(4).Infof("rbd: info %s using mon %s, pool %s id %s key %s", b.Image, mon, b.Pool, id, secret) output, err = b.exec.Command("rbd", - "info", b.Image, "--pool", b.Pool, "-m", mon, "--id", id, "--key="+secret, "-k=/dev/null", "--format=json").CombinedOutput() + "info", b.Image, "--pool", b.Pool, "-m", mon, "--id", id, "--key="+secret, "-k=/dev/null", "--format=json").Output() if err, ok := err.(*exec.Error); ok { if err.Err == exec.ErrNotFound {