-
Notifications
You must be signed in to change notification settings - Fork 546
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
ImageCustomizer: Implement new MIC Overlays APIs. #10138
Conversation
8953e4a
to
f395218
Compare
if strings.Contains(path, " ") { | ||
return fmt.Errorf("path (%s) contains spaces and is invalid", path) | ||
// Check if the path contains spaces. | ||
if strings.Contains(filePath, " ") { |
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.
It would probably be good to also exclude tabs, newlines, colons, and commas to help avoid the path values from messing up the fstab file's formatting.
strings.ContainsAny could be handy for this.
Also, if you could also use validatePath
for MountPoint.Path
that would be greatly appreciated.
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.
Added, please check.
} | ||
} | ||
|
||
if strings.Contains(o.MountOptions, " ") { |
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.
It would probably be good to also exclude tabs and newlines.
Also, if you could apply the same check to MountPoint.Options
that would be greatly appreciated.
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.
Added, please check.
024c5ec
to
8c58876
Compare
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-static
subpackages, etc.) have had theirRelease
tag incremented../cgmanifest.json
,./toolkit/scripts/toolchain/cgmanifest.json
,.github/workflows/cgmanifest.json
)./LICENSES-AND-NOTICES/SPECS/data/licenses.json
,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md
,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON
)*.signatures.json
filessudo make go-tidy-all
andsudo make go-test-coverage
passSummary
What does the PR accomplish, why was it needed?
This PR restructures the MIC Overlays APIs, optimizing the process by transitioning from relying on the initrd module script for enabling overlays to leveraging the fstab file. The changes streamline the Overlay feature, making it more generic and easier for users to configure and use.
Does this affect the toolchain?
NO
Associated issues
Test Methodology
overlays
field from the config file:df -h
:fstab
: