-
Notifications
You must be signed in to change notification settings - Fork 11
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
adding path suffix to multipath chroot command #64
base: main
Are you sure you want to change the base?
adding path suffix to multipath chroot command #64
Conversation
Please run sanity tests and attach the results |
@@ -200,7 +201,7 @@ func (mp *Multipath) runCommand(ctx context.Context, command string, args []stri | |||
} | |||
|
|||
if mp.chroot != "" { | |||
args = append([]string{mp.chroot, command}, args...) | |||
args = append([]string{mp.chroot + os.Getenv("MP_CHROOT_SUFFIX"), command}, args...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no validation of the contents of the variable. I'm a little concerned with the security implications of this. Should there be some validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that's a good point. How would you propose that validation happens here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps there is another way to go about this all together that would be better? I wasn't super familiar with this project, and just needed to get things working for my environment, so I may have taken a non-optimal approach to this. I'm open to suggestions.
Description
This PR adds the ability to add a path suffix to the chroot command issued when trying to invoke multipath commands through an environment variable called MP_CHROOT_SUFFIX. This was necessary on the environment I work in because our multipath daemon and associated binaries are located in /usr/local. When the chroot command would run it would try to chroot to /noderoot, but in my case it needed to chroot to /noderoot/usr/local. The additional env var allows this to happen without impacting current functionality. If there is another way you would like this implemented I'm open to suggestions.
The reason my multipath daemon is installed in /usr/local is because we are running a distribution called Talos (https://www.talos.dev/). This distribution does not come with multipath, and also has an immutable root filesystem, but they do have a system for adding extensions into /usr/local. So I have created a multipath extension for this distro that installs multipath into /usr/local.
GitHub Issues
N/A
Checklist:
How Has This Been Tested?
This has been tested by running local unit tests as well as running in my environment with the Dell Unity CSI Driver (https://github.com/dell/csi-unity). I validated that in our environment the multipath commands are now being executed correctly because of the updated chroot path.
If this PR is accepted there should also be an update made to the values file for the csi-unity helm chart that documents that this variable is available and the impact it can have.