-
Notifications
You must be signed in to change notification settings - Fork 245
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
filesystem.go: add warning when path matches device #1412
Conversation
6c7921a
to
56ed15a
Compare
Ready for review! |
81be3a5
to
4ea31d3
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.
FWIW, I don't see much point to the refactor in the second commit. It doesn't meaningfully simplify the code (e.g. by separating out local variables or clarifying what each section does), and does add extra structure to navigate. Or put the other way, IMO it's easy enough to look at each iterand in the original function and see what the code is trying to do. But if you think the change meaningfully helps, I'm okay with it.
cd4f10d
to
34b8c6e
Compare
I think it does. From my perspective, naming the responsibility's of the many loops gives a high level overview of what is being "validated()". Additionally it allows for each set of validation to be individually tested. (is not currently lol but can be). So while its not dramatic I think it does add value at a glance. |
Remember to update the release notes, too. |
09028b3
to
5d1a0d1
Compare
5d1a0d1
to
1127fdf
Compare
Updated! |
Also: the commit message says what the change does, but not why. The former is good but not as important, since folks can read the diff if necessary. The latter might not be clear from the diff alone. Also also, it'd be good for the commit message to link to the issue (with the |
1bc9b12
to
108b176
Compare
Great point, took a swing let me know.
Absolutely thank you |
995b4a1
to
fe6d7ab
Compare
c6025cd
to
4ef60e5
Compare
I did get this updated, I think it should be ready to rock and roll. @bgilbert |
61344f6
to
8bdefec
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.
Looks good generally; one issue and a couple nits.
The second paragraph of the commit message could probably use some cleanup, since it isn't super-clear.
8bdefec
to
228ae14
Compare
Ready to go ! |
228ae14
to
6209121
Compare
Fixes coreos#1397, a common configuration error is to create a filesystem over a whole-disk device rather than a partition. Add a warning for a filesystem device matching the disk device. Additionally, another configuration error was identified for a way to recreate the filesystem on every provision, while the configuration to do so is valid, it might be done unitionally. Add a warning when wipeTable is true but wipeFilesystem is false.
Separate validate() into more granular subfunctions which describe the unit of work they are performing to improve readability and testability.
6209121
to
b099378
Compare
#1397
Added simple check at filesystem validation to ensure that we warn when the Path matches the Device.
Naming is hard, could use some input around Err name, and function naming. "ValidatePath" was taken so I tried to make do.