-
Notifications
You must be signed in to change notification settings - Fork 26
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
coreos: update aleph version handling #585
coreos: update aleph version handling #585
Conversation
I'm sure someone that knows rust better than I do can show me a much more elegant way to implement the 2nd commit here. What I have right now is kind of ugly IMO. |
c87a979
to
b3cf258
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.
OK so, the only (non-informational) use of the aleph data is for adoption on very old coreos systems. Think about a case of updating from e.g. RHCOS 4.3 (RHEL 8.x) all the way to a modern version. We still need to parse the old aleph file for that; we can't just hard switch.
Probably simplest is to change every field to Option<>.
Or...honestly (and this relates to a larger topic of bootupd versioning) we could just extract the btime of the aleph file...or failing that, hmm we could probably rely on the btime of /boot or /sysroot/ostree. Basically our use of the aleph file here is just to have a "pretty" version but...who cares, we can just use timestamp-as-version.
I agree that we can't hard switch. I thought the changes I was doing here were backwards compatible so thank you for pointing out that they aren't! I thought by making it:
Would mean that if
I removed all the other values from the
I kind of like having the version information, but I guess we could cut it out. Either way I'm mostly trying to not break things when we switch to OSBuild. |
b3cf258
to
e8a9d8c
Compare
I realized we were not failing if the file didn't exist before and my new code was failing if it didn't exist. Updated to not fail if no file exists. I feel like the second commit is still really ugly and there is probably a much more elegant way to say "read this file, or the file this symlink points to if it is a symlink". |
Ah sorry...yes, I think that will work, however what would increase my confidence here a lot is to leave the existing unit test unchanged to prove we continue to parse the old format, and add a new unit test instead. |
I think that's a deficiency of the |
e8a9d8c
to
504697a
Compare
Good idea! Done! |
Changes LGTM. I'm trying to figure out the CI failure now. |
Ah yes, "no components are adoptable" means we messed up something with the aleph detection for "this is a coreos system". |
Ah I see the error is
And that's because the old aleph data has both
|
For my and others' future reference, a handy guestfish interaction session to get this data from an old qcow2:
|
How is that different from our current |
IIUC the error is happening when
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
oh actually I think I might know the issue here: coreos/coreos-assembler@c2d37f4 I was trying to be helpful with that but I think it caused a problem. |
Ah. Yes, that commit created an aleph format which is neither the "v1" nor "v2"; probably should just revert. |
An easy solution to the problem is to revert that commit and scratch the builds that we started today since we haven't released them yet. |
This reverts commit c2d37f4. We found an issue with this and need to revert it for now: coreos/bootupd#585 (comment)
This reverts commit c2d37f4. We found an issue with this and need to revert it for now: coreos/bootupd#585 (comment)
bdb8bed
to
214705b
Compare
In osbuild/osbuild#1475 we are updating aleph version to have more information and some of the fields are changing slightly. Notably here `imgid` is no longer going to be populated and `build` -> `version` now. Let's make these tweaks and also just drop any fields from the definition here that we aren't using to tolerate changes better.
Once osbuild/osbuild#1475 gets picked up and starts getting used the .coreos-aleph-version.json will be a symlink. Let's canonicalize and find the actual file before dropping into sysroot.open_file_optional() because the underlying code for that uses O_NOFOLLOW and will give an ELOOP (too many symbolic links) error.
This makes it amenable to unit testing, and also since the previous code was always operating on `/` there's no good reason to use the `openat` APIs which don't follow symlinks by default, which breaks ergonomics.
214705b
to
8d746cd
Compare
In osbuild/osbuild#1475 we are updating
aleph version to have more information and some of the fields
are changing slightly. Notably here
imgid
is no longer going tobe populated and
build
->version
now. Let's make these tweaksand also just drop any fields from the definition here that we
aren't using to tolerate changes better.