rbd: fix bug handling GetKrbdSupportedFeatures()

continue running rbd driver when /sys/bus/rbd/supported_features file is
missing, do not bailout.

Fixes: #2678
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
(cherry picked from commit 6470cf3343)
This commit is contained in:
Prasanna Kumar Kalever 2022-04-14 15:19:17 +05:30 committed by mergify[bot]
parent a67bf8928c
commit 9f5908d873

View File

@ -17,7 +17,9 @@ limitations under the License.
package rbddriver package rbddriver
import ( import (
"errors"
"fmt" "fmt"
"os"
casrbd "github.com/ceph/ceph-csi/internal/csi-addons/rbd" casrbd "github.com/ceph/ceph-csi/internal/csi-addons/rbd"
csiaddons "github.com/ceph/ceph-csi/internal/csi-addons/server" csiaddons "github.com/ceph/ceph-csi/internal/csi-addons/server"
@ -144,7 +146,7 @@ func (r *Driver) Run(conf *util.Config) {
} }
var attr string var attr string
attr, err = rbd.GetKrbdSupportedFeatures() attr, err = rbd.GetKrbdSupportedFeatures()
if err != nil { if err != nil && !errors.Is(err, os.ErrNotExist) {
log.FatalLogMsg(err.Error()) log.FatalLogMsg(err.Error())
} }
var krbdFeatures uint var krbdFeatures uint