First, this adds `cargo xtask` following
https://github.com/matklad/cargo-xtask/
We use this to write "external glue scripts" in Rust, not bash.
Specifically we now have e.g. `cargo xtask vendor` which just
wraps running `cargo vendor-filterer`.
Then build on that and add `cargo xtask package-srpm` which generates
a `.src.rpm`.
And build on that by adding the requisite glue to have Fedora's COPR
be able to understand it, so that we can get auto-built and shipped
packages there.
This will make trying out bootc a bit easier.
Signed-off-by: Colin Walters <walters@verbum.org>
Add a feature to enable internal tests. I originally started
by matching
6543c85558
but since here the binary is really end user facing and not just
a demo, we shouldn't enable the feature by default.
If in the future we split off the tiny CLI bit out of the workspace,
then we could auto-enable but that seems not worth it.
Signed-off-by: Colin Walters <walters@verbum.org>
This uses the new ostree API to verify we're in a compatible
SELinux domain. Otherwise, it's a really evil trap because
things *seem* to work fine but will just explode in the case
when trying to do a major policy update.
Signed-off-by: Colin Walters <walters@verbum.org>
Add a helper `stage()` which takes all the data we need,
and use it in both the `upgrade` and `switch` paths. This drops
out an "internal error" message and avoids the "utils" code growth.
Signed-off-by: Colin Walters <walters@verbum.org>
This is a bug in the ostree Rust bindings, it can't
express the difference between a zero-length array and an unset
array.
And if we provide a zero-length array, ostree will happily remove
all other kargs.
Signed-off-by: Colin Walters <walters@verbum.org>
Add an API to gather our extra metadata from a single deployment, such
as the supported status. Use it in the status path and the upgrade
path, instead of gathering the supported state separately.
Signed-off-by: Colin Walters <walters@verbum.org>
If one does any machine-local layering/overrides via rpm-ostree,
we really should error out if one does `bootc upgrade`; otherwise
we'll just lose their changes.
This is a bit of an ugly hack; what would be more elegant is
to add something like a clear `owner` flag into origin files, and
have rpm-ostree flip that on if it needs to take over.
But for now, let's do this to avoid more confusion.
Signed-off-by: Colin Walters <walters@verbum.org>
This test will
- build a container image derived from FCOS, injecting bootc-under-test
into it
- Schedule a separate container derived from coreos-assembler
which has a reference to that container injected via
https://docs.ci.openshift.org/docs/architecture/ci-operator/#referring-to-images-in-tests
- Run the stable FCOS base image via kola (qemu), injecting the target oscontainer
- Execute a basic test that just verifies `status --json` today
However, in the future we can change the build system to generate
multiple container images, and test upgrades, rollbacks, etc.
Signed-off-by: Colin Walters <walters@verbum.org>