Skip to content

Commit

Permalink
Add support for configmaps
Browse files Browse the repository at this point in the history
This is part of containers#22
  • Loading branch information
cgwalters committed Aug 13, 2023
1 parent e0045a6 commit 486497b
Show file tree
Hide file tree
Showing 10 changed files with 846 additions and 34 deletions.
1 change: 1 addition & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ tempfile = "3.3.0"
toml = "0.7.2"
xshell = { version = "0.2", optional = true }
uuid = { version = "1.2.2", features = ["v4"] }
reqwest = { version = "0.11.14", features = ["json"] }

[features]
default = ["install"]
Expand Down
10 changes: 10 additions & 0 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use ostree_ext::container as ostree_container;
use ostree_ext::container::SignatureSource;
use ostree_ext::keyfileext::KeyFileExt;
use ostree_ext::ostree;
use ostree_ext::sysroot::SysrootLock;
use std::ffi::OsString;
use std::io::Seek;
use std::os::unix::process::CommandExt;
Expand Down Expand Up @@ -129,6 +130,9 @@ pub(crate) enum Opt {
/// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
#[clap(alias = "usroverlay")]
UsrOverlay,
/// Manipulate configuration
#[clap(subcommand)]
Config(crate::config::ConfigOpts),
/// Install to the target block device
#[cfg(feature = "install")]
Install(crate::install::InstallOpts),
Expand Down Expand Up @@ -254,6 +258,11 @@ pub(crate) async fn prepare_for_write() -> Result<()> {
Ok(())
}

pub(crate) fn target_deployment(sysroot: &SysrootLock) -> Result<ostree::Deployment> {
let booted_deployment = sysroot.require_booted_deployment()?;
Ok(sysroot.staged_deployment().unwrap_or(booted_deployment))
}

/// Implementation of the `bootc upgrade` CLI command.
#[context("Upgrading")]
async fn upgrade(opts: UpgradeOpts) -> Result<()> {
Expand Down Expand Up @@ -435,6 +444,7 @@ where
Opt::Switch(opts) => switch(opts).await,
Opt::Edit(opts) => edit(opts).await,
Opt::UsrOverlay => usroverlay().await,
Opt::Config(opts) => crate::config::run(opts).await,
#[cfg(feature = "install")]
Opt::Install(opts) => crate::install::install(opts).await,
#[cfg(feature = "install")]
Expand Down
Loading

0 comments on commit 486497b

Please sign in to comment.