-
Notifications
You must be signed in to change notification settings - Fork 329
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
feat: add namePattern field in discovery PV #187
feat: add namePattern field in discovery PV #187
Conversation
if config.DeviceNameMatching != "" && !strings.Contains(file, config.DeviceNameMatching) { | ||
klog.Infof("file(%s) under(%s) does not match %s", file, config.MountDir, config.DeviceNameMatching) | ||
continue | ||
} |
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.
how about making it generic?
- rename
DeviceNameMatching
toNamePattern
(filesystem mount points are also matched here) - use filepath.Match to match on file name
- default value is
*
if not specified (matching all names)
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.
in your case, the pattern will be nvm*
, the same pattern used in the shell.
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.
sounds good, will change the PR soon
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.
thanks, it's done. To make sure it's backward compatible, when namePattern
is empty string, it would not invoke filepath.Match
, so empty == "*" 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.
LGTM, btw can you add a helm value for this configuration (see example, e.g. classes.[n].fsType
)? you can do it in a separate PR.
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.
sure, thanks for the review
b3fb89e
to
665682a
Compare
fix comments typo
665682a
to
f46da07
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, cofyc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…tching feat: add namePattern field in discovery PV
This PR is to add a
namePattern
field, with following config, only/dev/nvm*
device names would be discovered, by defaultnamePattern
field is empty, it won't do any matching, so it's backward compatible./assign @cofyc