-
Notifications
You must be signed in to change notification settings - Fork 70
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
fcos/v1_6_exp: warn if config attempts to reuse partition by label #436
Conversation
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 working on this!
FYI, #434 will land first, so you'll eventually have to rebase this onto |
e561669
to
66a46d6
Compare
Marking this as a Draft PR as i'm not too familiar with butane yet. |
c4bb164
to
0834659
Compare
a2cad53
to
06ccf78
Compare
Test is working fine now : fails when a partition has the number 0 and wipe_tables is set to false |
Have you manually tested with the config from #377? |
I haven't only the test that is in translate_test.go and i'm not entirely sure how i would go about testing manually |
You should be able to just run Butane and pass it the config, and see whether it outputs the warning. |
this is the output i got : adamobrien@fedora:~/coreos/coreos-butane/butane(p-tables-tests⚡) » butane config.yaml 2 ↵ looks okay |
There's no warning there. |
There's not supposed to be a warning is there? |
|
my bad i thought there shouldn't be one taking a look now! |
okay so after running this config on a local build
generates a .ign fine but if i was to change the number from 1 -> 0 then i get the following error |
You're declaring two separate partitions but I think you're intending to declare one. You'll probably want to drop the |
my bad didn't know that made a new partition. tested it without the |
24cb90c
to
b6dcefc
Compare
At the moment if i use this config butane will return the error message "Partition number cannot be zero.% "
|
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.
The PR title and commit message still need details.
195cc38
to
f7d1495
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.
Tests are failing.
For the commit message, I wrote this text:
Suggestions/edits welcome. |
82ba4e8
to
7ec5e1f
Compare
7ec5e1f
to
96768c3
Compare
3a7ebe0
to
d513c50
Compare
b112b73
to
aa9010a
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 overall! A couple small fixes and then this should be ready.
LGTM. Please squash your commits and I'll approve. |
986df30
to
8cc1ebe
Compare
Ignition matches existing partitions by number, not by label. When reusing an existing partition table, if the config specifies a label and leaves the number at the default of 0, Ignition will try to add a new partition rather than reusing any existing one. That was probably not the user's intention, so warn in this case. However, the boot disk is a common exception, since it has a fresh partition table on every run. On FCOS we can detect the alias /dev/disk/by-id/coreos-boot-disk and not warn, but that alias was added recently and older configs won't use it. On other variants we don't have any way to detect the boot disk. Therefore, don't implement the warning in base and don't make it retroactive to existing stable specs; only add it to the FCOS experimental spec.
8cc1ebe
to
63d3a3c
Compare
Fix : #377