Repository navigation
Conversation
bb60af1 to
52d0c26
Compare
| Details []struct { | ||
| Name string `json:"name"` | ||
| Enabled *bool `json:"enabled"` | ||
| } `json:"details"` |
There was a problem hiding this comment.
Is the syntax for this settled already?
Not sure where this comes from, but having two different arrays for components and details and then having to iterate both, create maps and all just to filter not enabled things seems annoying.
But maybe this comes from a spec or something already established that we can't change?
There was a problem hiding this comment.
It comes from systemd-sysupdate and is probably already being parsed by the GnomeOS folks. But yeah I agree it's really unfortunate.
| Components []string `json:"components"` | ||
| Details []struct { | ||
| Name string `json:"name"` | ||
| Enabled *bool `json:"enabled"` |
There was a problem hiding this comment.
Don't we need the omitempty tag here? Or to the whole details struct either?
There was a problem hiding this comment.
FWIW it would be a no-op for parsing.
"systemd-sysupdate update" fails with an error if a component is disabled, so we cannot just indiscriminately call it for every component. We need to parse out (from "systemd-sysupdate components") which components are actually enabled. We didn't notice this issue earlier because .component files were also not being linked into the runtime /etc at all, which will be fixed in a later patch in this series. This should no longer be needed after we switch to the built-in --all-components flag for systemd-sysupdate. Signed-off-by: Michael Vogt <michael@amutable.com> Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
Previously we would skip these files if distributed which meant that disabled-by-default and runtime-enabled components would not be installed correctly. This only fixes clients consuming these files, a later patch in this series fixes hardhat to properly generate these component files. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
52d0c26 to
3b48d6d
Compare
There is no need to pass around file contents as maps of paths and bytes or having the kinda complicated collation code with restrictions about duplicates. Really we should be merging all of the provided directory contents as much as possible. Fixes: 57c679a ("hardhat: publish sysupdate definitions inline with --quarry-transfer-dir") Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
Injecting a pointless [Source] Path=... value doesn't make sense for any non-transfer / non-transfer-drop-in files. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
…omponent To make using the CLI easier the foo.component file is still provided inside the component directory but we now hoist it into the top-level directory so that it can be installed by clients properly. This also means we now reject component directories that have a different .component file inside them, since they will be ignored (and are kind of weird to have in the first place). Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
3b48d6d to
af17331
Compare
mvo5
left a comment
There was a problem hiding this comment.
👍 Looks good to me, one tiny question but from my PoV this can go in
| // top of the source is published as the component file. Any other | ||
| // *.component file is an error. | ||
| func definitionTargetPath(componentDir, rel string) (string, error) { | ||
| if !strings.HasSuffix(rel, ".component") { |
There was a problem hiding this comment.
Should we also do something like this for .component.d drop-in dirs? Also reject?
I am working on installs k8s from its TUF repository [1]. It is currently a combined repo, i.e. it contains k8s-{cp,worker}. But currently sysupdate/quarry always installs k8s-cp and k8s-worker. The reason is that while we support optional feature we don't link them into the right place for components. So this PR makes that work by linking the components into the right place and also skips disabled components on update.
There might be more work following but this should unblock the next steps in testing.
[1] https://github.com/amutable/amutablectl/compare/config-k8s?expand=1