Skip to content

Commit 486497b

Browse files
committed
Add support for configmaps
This is part of #22
1 parent e0045a6 commit 486497b

File tree

10 files changed

+846
-34
lines changed

10 files changed

+846
-34
lines changed

lib/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ tempfile = "3.3.0"
4040
toml = "0.7.2"
4141
xshell = { version = "0.2", optional = true }
4242
uuid = { version = "1.2.2", features = ["v4"] }
43+
reqwest = { version = "0.11.14", features = ["json"] }
4344

4445
[features]
4546
default = ["install"]

lib/src/cli.rs

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use ostree_ext::container as ostree_container;
1414
use ostree_ext::container::SignatureSource;
1515
use ostree_ext::keyfileext::KeyFileExt;
1616
use ostree_ext::ostree;
17+
use ostree_ext::sysroot::SysrootLock;
1718
use std::ffi::OsString;
1819
use std::io::Seek;
1920
use std::os::unix::process::CommandExt;
@@ -129,6 +130,9 @@ pub(crate) enum Opt {
129130
/// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
130131
#[clap(alias = "usroverlay")]
131132
UsrOverlay,
133+
/// Manipulate configuration
134+
#[clap(subcommand)]
135+
Config(crate::config::ConfigOpts),
132136
/// Install to the target block device
133137
#[cfg(feature = "install")]
134138
Install(crate::install::InstallOpts),
@@ -254,6 +258,11 @@ pub(crate) async fn prepare_for_write() -> Result<()> {
254258
Ok(())
255259
}
256260

261+
pub(crate) fn target_deployment(sysroot: &SysrootLock) -> Result<ostree::Deployment> {
262+
let booted_deployment = sysroot.require_booted_deployment()?;
263+
Ok(sysroot.staged_deployment().unwrap_or(booted_deployment))
264+
}
265+
257266
/// Implementation of the `bootc upgrade` CLI command.
258267
#[context("Upgrading")]
259268
async fn upgrade(opts: UpgradeOpts) -> Result<()> {
@@ -435,6 +444,7 @@ where
435444
Opt::Switch(opts) => switch(opts).await,
436445
Opt::Edit(opts) => edit(opts).await,
437446
Opt::UsrOverlay => usroverlay().await,
447+
Opt::Config(opts) => crate::config::run(opts).await,
438448
#[cfg(feature = "install")]
439449
Opt::Install(opts) => crate::install::install(opts).await,
440450
#[cfg(feature = "install")]

0 commit comments

Comments
 (0)