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

Warn, instead of failing, if 'modprobe rbd' fails #46016

Merged
merged 1 commit into from
Jun 13, 2017
Merged
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
2 changes: 1 addition & 1 deletion pkg/volume/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (util *RBDUtil) AttachDisk(b rbdMounter) error {
// modprobe
_, err = b.plugin.execCommand("modprobe", []string{"rbd"})
if err != nil {
return fmt.Errorf("rbd: failed to modprobe rbd error:%v", err)
glog.Warningf("rbd: failed to load rbd kernel module:%v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, can you check if the module is already loaded? Then return an error if it isn't loaded, and ignore this error if it is loaded already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue with checking is that if Kubelet runs as a self-hosted or in a container, it wouldnt be able to do any modprobe operation. Ideally, this plugin should not be responsible for loading the kernel module. This is usually a one-time operation and done by the admin that setups the hosts. Even If the module is not loaded, we will get an error just a few lines after when it tries to attach the volume.

}

// fence off other mappers
Expand Down