Turn staged deployments on by default
We've put a lot of work into staged deployments, it's time to pull the trigger and turn them on by default. This is a key step for enabling `stage` mode automatic updates by default in e.g. Fedora CoreOS/Silverblue. We add a new `--disable-staged` build-time option to flip things back. Closes: #1430 Approved by: jlebon
This commit is contained in:
parent
44b39a7340
commit
b6d07487d5
10
configure.ac
10
configure.ac
@ -94,7 +94,7 @@ LIBS="$save_LIBS"
|
||||
# Remember to update AM_CPPFLAGS in Makefile.am when bumping GIO req.
|
||||
PKG_CHECK_MODULES(PKGDEP_GIO_UNIX, [gio-unix-2.0])
|
||||
PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [gio-unix-2.0 >= 2.50.0 json-glib-1.0
|
||||
ostree-1 >= 2018.2
|
||||
ostree-1 >= 2018.7
|
||||
libsystemd
|
||||
polkit-gobject-1
|
||||
rpm librepo libsolv
|
||||
@ -186,6 +186,14 @@ AS_IF([test x$enable_compose_tooling = xyes], [
|
||||
])
|
||||
if test x$enable_compose_tooling != xno; then RPM_OSTREE_FEATURES="$RPM_OSTREE_FEATURES compose"; fi
|
||||
|
||||
AC_ARG_ENABLE(staged,
|
||||
AS_HELP_STRING([--disable-staged],
|
||||
[Disable staged deployments by default]),,
|
||||
[enable_staged=yes])
|
||||
AS_IF([test x$enable_staged = xyes], [
|
||||
AC_DEFINE(BUILDOPT_STAGE_DEPLOYMENTS, 1, [Define if we are staging deployments])
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(rust,
|
||||
AS_HELP_STRING([--enable-rust],
|
||||
[Compile Rust features (e.g. compose tree --yaml)]),,
|
||||
|
@ -422,8 +422,18 @@ rpmostreed_daemon_reload_config (RpmostreedDaemon *self,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self->ex_stage_deployments = g_key_file_get_boolean (config, EXPERIMENTAL_CONFIG_GROUP,
|
||||
"StageDeployments", NULL);
|
||||
/* The default used to be `false`, so check for the key being present */
|
||||
if (g_key_file_has_key (config, EXPERIMENTAL_CONFIG_GROUP, "StageDeployments", NULL))
|
||||
self->ex_stage_deployments = g_key_file_get_boolean (config, EXPERIMENTAL_CONFIG_GROUP,
|
||||
"StageDeployments", NULL);
|
||||
else
|
||||
{
|
||||
#ifdef BUILDOPT_STAGE_DEPLOYMENTS
|
||||
self->ex_stage_deployments = TRUE;
|
||||
#else
|
||||
self->ex_stage_deployments = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* don't update changed for this; it's contained to RpmostreedDaemon so no other objects
|
||||
* need to be reloaded if it changes */
|
||||
|
@ -24,6 +24,10 @@ set -euo pipefail
|
||||
|
||||
set -x
|
||||
|
||||
# We do various assertions on deployment length, need a reliably
|
||||
# clean slate.
|
||||
vm_rpmostree cleanup -pr
|
||||
|
||||
vm_cmd 'echo "[Experimental]" >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=true >> /etc/rpm-ostreed.conf'
|
||||
vm_rpmostree reload
|
||||
|
@ -29,9 +29,9 @@ set -x
|
||||
# This test suite enables the libostree staging feature, and executes
|
||||
# the layering-relayer tests.
|
||||
|
||||
export VMCHECK_FLAGS=stage-deployments
|
||||
export VMCHECK_FLAGS=not-stage-deployments
|
||||
vm_cmd 'echo "[Experimental]" >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=true >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=false >> /etc/rpm-ostreed.conf'
|
||||
vm_rpmostree reload
|
||||
|
||||
${dn}/test-layering-relayer.sh
|
||||
|
@ -29,9 +29,9 @@ set -x
|
||||
# This test suite enables the libostree staging feature, and executes
|
||||
# the upgrade and layering-relayer tests.
|
||||
|
||||
export VMCHECK_FLAGS=stage-deployments
|
||||
export VMCHECK_FLAGS=not-stage-deployments
|
||||
vm_cmd 'echo "[Experimental]" >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=true >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=false >> /etc/rpm-ostreed.conf'
|
||||
vm_rpmostree reload
|
||||
|
||||
${dn}/test-upgrades.sh
|
||||
|
@ -77,9 +77,9 @@ fi
|
||||
if vm_cmd test -f /usr/etc/rpm-ostreed.conf; then
|
||||
vm_cmd cp -f /usr/etc/rpm-ostreed.conf /etc
|
||||
# Unless we're doing overrides
|
||||
if [[ "${VMCHECK_FLAGS:-}" =~ "stage-deployments" ]]; then
|
||||
if [[ "${VMCHECK_FLAGS:-}" =~ "not-stage-deployments" ]]; then
|
||||
vm_cmd 'echo "[Experimental]" >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=true >> /etc/rpm-ostreed.conf'
|
||||
vm_cmd 'echo StageDeployments=false >> /etc/rpm-ostreed.conf'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user