fix CI: skip prereq check for mock backend, add bash to opensuse

- Add KARAPACE_SKIP_PREREQS=1 env var check to skip runtime prerequisite
  checks (user namespaces, fuse-overlayfs) when testing with mock backend
- Set KARAPACE_SKIP_PREREQS=1 in CLI integration test helper
- Add bash to opensuse/tumbleweed container deps (required by
  dtolnay/rust-toolchain action)
This commit is contained in:
Marco Allegretti 2026-02-22 19:56:47 +01:00
parent 3091e5e932
commit fd7313a318
3 changed files with 7 additions and 4 deletions

View file

@ -64,7 +64,7 @@ jobs:
run: dnf install -y gcc make curl run: dnf install -y gcc make curl
- name: Install build deps (openSUSE) - name: Install build deps (openSUSE)
if: matrix.os == 'opensuse' if: matrix.os == 'opensuse'
run: zypper install -y gcc make curl gzip tar xz run: zypper install -y gcc make curl gzip tar xz bash
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ env.RUST_TOOLCHAIN }} toolchain: ${{ env.RUST_TOOLCHAIN }}
@ -136,7 +136,7 @@ jobs:
setup: "dnf install -y gcc make curl fuse-overlayfs fuse3 crun" setup: "dnf install -y gcc make curl fuse-overlayfs fuse3 crun"
- os: opensuse - os: opensuse
container: opensuse/tumbleweed:latest container: opensuse/tumbleweed:latest
setup: "zypper install -y gcc make curl fuse-overlayfs gzip tar xz crun" setup: "zypper install -y gcc make curl fuse-overlayfs gzip tar xz bash crun"
container: ${{ matrix.container }} container: ${{ matrix.container }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -203,7 +203,7 @@ fn main() -> ExitCode {
| Commands::Exec { .. } | Commands::Exec { .. }
| Commands::Rebuild { .. } | Commands::Rebuild { .. }
); );
if needs_runtime { if needs_runtime && std::env::var("KARAPACE_SKIP_PREREQS").as_deref() != Ok("1") {
let missing = karapace_runtime::check_namespace_prereqs(); let missing = karapace_runtime::check_namespace_prereqs();
if !missing.is_empty() { if !missing.is_empty() {
eprintln!("error: {}", karapace_runtime::format_missing(&missing)); eprintln!("error: {}", karapace_runtime::format_missing(&missing));

View file

@ -6,7 +6,10 @@
use std::process::Command; use std::process::Command;
fn karapace_bin() -> Command { fn karapace_bin() -> Command {
Command::new(env!("CARGO_BIN_EXE_karapace")) let mut cmd = Command::new(env!("CARGO_BIN_EXE_karapace"));
// Skip runtime prerequisite checks — mock backend does not need user namespaces
cmd.env("KARAPACE_SKIP_PREREQS", "1");
cmd
} }
fn temp_store() -> tempfile::TempDir { fn temp_store() -> tempfile::TempDir {