deployment: enable adding custom metadata#3212
deployment: enable adding custom metadata#3212jmarrero wants to merge 1 commit intoostreedev:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
| } | ||
|
|
||
| ret = TRUE; | ||
| out: |
There was a problem hiding this comment.
In brand new code we can avoid use of goto and just use return FALSE above
|
|
||
| if (opt_get) | ||
| { | ||
| ostree_deployment_get_ext_metadata (first_deployment, *opt_get, error); |
| { | ||
| g_autofree char *backing_relpath = _ostree_sysroot_get_deployment_backing_relpath (self); | ||
| g_autofree char *metadata_value = NULL; | ||
| g_autofree int len = getxattr (backing_relpath, metadata_key, NULL, 0); |
There was a problem hiding this comment.
In the general case ostree wants to support using fd-relative paths, so we need to open a fd for the dir (relative to self->sysroot_fd), then use fgetxattr().
There was a problem hiding this comment.
Also
g_autofree int len
Definitely don't want to call free() on an integer. Also, getxattr returns a ssize_t, not an int (they're different sizes).
| OstreeDeploymentUnlockedState ostree_deployment_get_unlocked (OstreeDeployment *self); | ||
|
|
||
| _OSTREE_PUBLIC | ||
| gboolean ostree_deployment_set_ext_metadata (OstreeDeployment *self, const char *metadata_key, |
There was a problem hiding this comment.
New API needs to be added to libostree-devel.sym; there's some ceremony to do that. See the comments around that and git log.
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This is a Work in progress and is very bad atm, still need to re-work it with GVariant and test it, but it builds locally... somehow.