-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CSI] Prevent stage_publish_base_dir from being subdir of mount_dir #19441
Conversation
@tgross can you take a look? |
fb3f373
to
1e3bcbd
Compare
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.
Hi @ggriffiths! Thanks for the PR!
In addition to addressing the comments I've posted, can you run make cl
to add a changelog entry for the fix once you're done?
6c3e9c4
to
b43088b
Compare
b43088b
to
e4afe83
Compare
Signed-off-by: Grant Griffiths <[email protected]>
e4afe83
to
303382b
Compare
@@ -7942,6 +7942,11 @@ func (t *Task) Validate(jobType string, tg *TaskGroup) error { | |||
mErr.Errors = append(mErr.Errors, fmt.Errorf("CSIPluginConfig PluginType must be one of 'node', 'controller', or 'monolith', got: \"%s\"", t.CSIPluginConfig.Type)) | |||
} | |||
|
|||
if t.CSIPluginConfig.StagePublishBaseDir != "" && t.CSIPluginConfig.MountDir != "" && | |||
strings.HasPrefix(t.CSIPluginConfig.StagePublishBaseDir, t.CSIPluginConfig.MountDir) { |
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 think this will handle most cases. For example, if stage_publish_base_dir=/local/csi
and mount_dir=/local
, then we'll error out.
However, we don't error out if stage_publish_base_dir=/csi and mount_dir=/local/csi
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.
This looks great @ggriffiths. Just the two minor suggestions left to accept and I think we can merge this.
Co-authored-by: Tim Gross <[email protected]>
Sounds good. Thanks for the quick review @tgross |
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.
LGTM
Fixes #19440