-
Notifications
You must be signed in to change notification settings - Fork 247
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
Ignition should fail validation if a file conflicts with the parent directory of another file/link/dir #1795
base: main
Are you sure you want to change the base?
Conversation
da6f0d3
to
08131d1
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.
Overall these look like a great start to TTD! looks like there is an understanding of the issue. Just a small pick and make sure to have a positive case that allows a file to be named the same as a parent directory as long as the parent directory is configured.
1d4720e
to
a32d127
Compare
Thanks for your review! Good idea, I added positive cases! |
This comment was marked as resolved.
This comment was marked as resolved.
c885f1d
to
a36c760
Compare
c0ed076
to
a7e36b7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Some benchmarking to check performance:
OTHER EXAMPLE:
OTHER EXAMPLE
|
0741e46
to
14501a9
Compare
b5512fb
to
831dd43
Compare
in: Config{ | ||
Storage: Storage{ | ||
Files: []File{ | ||
{Node: Node{Path: "C:\\foo\\bar"}}, |
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.
That looks weird. Why are we validating this with Windows style paths here? This is only about the final system which Linux only AFAIK.
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 for pointing that out.
I was having CI failures on Windows, so I created tests to see if my validations applied to Windows as well. They're now working on Windows, but the unit tests should indeed be exclusive to Linux.
831dd43
to
ac5237b
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.
You shouldn't merge the main branch here. You need to rebase instead
ac5237b
to
0e1a9c1
Compare
0e1a9c1
to
b6afaa5
Compare
Have you had any luck with building the kola tests locally to see what is going on? |
b6afaa5
to
194cee9
Compare
194cee9
to
61dee39
Compare
Issue Summary:
Ignition has a bug (tracked in GitHub issue #1457) where it lacks proper validation when a file conflicts with the parent directory of another file, link, or directory. This bug allows users to create configurations that lead to internal inconsistencies. Feel free to verify this in Jira as well.
Expected Behavior:
Ignition should reject configurations that result in internal inconsistencies. Specifically, it should fail validation when files, links, or directories conflict with implicit parent directories.
Actual Behavior:
Currently, users can specify a file that conflicts with the parent directory, leading to potential internal inconsistencies.
Reproduction Steps:
Write a configuration with a file at /foo/bar and a file/directory/link at /foo/bar/baz.
OR
Write a configuration with a file at /foo/bar and a directory at /foo/bar/baz.
OR
Write a configuration with a file at /foo/bar and a link at /foo/bar/baz.