File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ checks as part of a container build
55
66# SYNOPSIS
77
8- ** bootc container lint** \[ ** -h** \| ** \- -help** \]
8+ ** bootc container lint** \[ ** \- -rootfs ** \] \[ ** -h** \| ** \- -help** \]
99
1010# DESCRIPTION
1111
@@ -17,6 +17,10 @@ part of a build process; it will error if any problems are detected.
1717
1818# OPTIONS
1919
20+ ** \- -rootfs** =* ROOTFS* \[ default: /\]
21+
22+ : Operate on the provided rootfs
23+
2024** -h** , ** \- -help**
2125
2226: Print help (see a summary with -h)
Original file line number Diff line number Diff line change @@ -241,7 +241,11 @@ pub(crate) enum ContainerOpts {
241241 ///
242242 /// This is intended to be invoked via e.g. `RUN bootc container lint` as part
243243 /// of a build process; it will error if any problems are detected.
244- Lint ,
244+ Lint {
245+ /// Operate on the provided rootfs.
246+ #[ clap( long, default_value = "/" ) ]
247+ rootfs : Utf8PathBuf ,
248+ } ,
245249}
246250
247251/// Subcommands which operate on images.
@@ -1007,13 +1011,13 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
10071011 Opt :: Edit ( opts) => edit ( opts) . await ,
10081012 Opt :: UsrOverlay => usroverlay ( ) . await ,
10091013 Opt :: Container ( opts) => match opts {
1010- ContainerOpts :: Lint => {
1014+ ContainerOpts :: Lint { rootfs } => {
10111015 if !ostree_ext:: container_utils:: is_ostree_container ( ) ? {
10121016 anyhow:: bail!(
10131017 "Not in a ostree container, this command only verifies ostree containers."
10141018 ) ;
10151019 }
1016-
1020+ let root = & Dir :: open_ambient_dir ( rootfs , cap_std :: ambient_authority ( ) ) ? ;
10171021 lints:: lint ( root) ?;
10181022 Ok ( ( ) )
10191023 }
You can’t perform that action at this time.
0 commit comments