-
Notifications
You must be signed in to change notification settings - Fork 198
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
[WIP] parse OCI deployment status #5208
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
A lot of discussion in #5196 |
The json-in-json we have now is obviously silly and unergonomic, and I am not opposed to trying to just change it. However, it is possible that something is parsing it as is today and there's some risk of breakage from that. Per discussion in the issue, my inclination is basically to try to fix this a different way for now - ideally one that ends up using bootc and leave rpm-ostree as is. |
To be able to always query that info from bootc, I think it also needs to support fishing it out of the OSTree commit even if there are layered packages. Anyway, feels weird to me to even have these keys in the I guess forking |
@@ -49,6 +50,7 @@ pub struct Deployment { | |||
pub pinned: bool, | |||
pub checksum: String, | |||
pub base_checksum: Option<String>, | |||
#[serde(deserialize_with = "deserialize_base_commit_meta")] |
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.
I think it'd be easier (and more reliable) to just add a method to this get_base_manifest(&self) -> Result<Option<oci_spec::image::ImageManifest>>
that directly accesses the expected key, instead of trying to heuristically parse every single metadata key as json.
When the deployment is an OCI image, the base_commit_meta field contains serialized JSON.
So the values in this map can either be:
- Regular OSTree case: a JSON object
- OCI case : a string containing a serialized JSON object
In the OCI case, simply deserialize the strings before passing them to serde, when necessary.
See #5196