feat(openebs): poolname input validation #21277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds input validation to the poolname / dataset variable to prevent users entering common invalid paths
/
/
\
in the pathix-applications
in the pathTANK
orTANK/
entriesAI Summary of regex pattern
In summary, this regex pattern matches strings that:
\
) anywhere./
)./
) followed by one or more characters that are not a/
.Here are some examples:
Matching examples:
hello/world/subdir
foo/bar/baz/qux
abc/def/ghi/jkl
Non-matching examples:
hello\world
(contains a backslash)ix-applications/anything
(contains the substring "ix-applications")hello/world/ix-applications
(contains the substring "ix-applications")/hello/world
(starts with a forward slash)Keep in mind that this regex pattern is quite specific, and it's likely designed to match a specific type of path or directory structure.
⚒️ Fixes #21275
⚙️ Type of change
🧪 How Has This Been Tested?
Tested via https://regex101.com/r/8aNdeE/1
📃 Notes:
✔️ Checklist:
feat(chart-name):
,fix(chart-name):
orchore(chart-name):
➕ App addition
If this PR is an app addition please make sure you have done the following.
icon.png
Please don't blindly check all the boxes. Read them and only check those that apply.
Those checkboxes are there for the reviewer to see what is this all about and
the status of this PR with a quick glance.