File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,10 @@ pub(crate) enum Opt {
167
167
/// Execute the given command in the host mount namespace
168
168
#[ cfg( feature = "install" ) ]
169
169
#[ clap( hide = true ) ]
170
- #[ command( external_subcommand) ]
171
- ExecInHostMountNamespace ( Vec < OsString > ) ,
172
-
170
+ ExecInHostMountNamespace {
171
+ #[ clap( trailing_var_arg = true , allow_hyphen_values = true ) ]
172
+ args : Vec < OsString > ,
173
+ } ,
173
174
/// Internal integration testing helpers.
174
175
#[ clap( hide( true ) , subcommand) ]
175
176
#[ cfg( feature = "internal-testing-api" ) ]
@@ -468,7 +469,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
468
469
InstallOpts :: ToFilesystem ( opts) => crate :: install:: install_to_filesystem ( opts) . await ,
469
470
} ,
470
471
#[ cfg( feature = "install" ) ]
471
- Opt :: ExecInHostMountNamespace ( args) => {
472
+ Opt :: ExecInHostMountNamespace { args } => {
472
473
crate :: install:: exec_in_host_mountns ( args. as_slice ( ) )
473
474
}
474
475
Opt :: Status ( opts) => super :: status:: status ( opts) . await ,
Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ pub(crate) fn run_in_host_mountns(cmd: &str) -> Command {
673
673
674
674
#[ context( "Re-exec in host mountns" ) ]
675
675
pub ( crate ) fn exec_in_host_mountns ( args : & [ std:: ffi:: OsString ] ) -> Result < ( ) > {
676
- let ( cmd, args) = args[ 1 .. ]
676
+ let ( cmd, args) = args
677
677
. split_first ( )
678
678
. ok_or_else ( || anyhow:: anyhow!( "Missing command" ) ) ?;
679
679
tracing:: trace!( "{cmd:?} {args:?}" ) ;
@@ -694,6 +694,7 @@ fn skopeo_supports_containers_storage() -> Result<bool> {
694
694
let o = run_in_host_mountns ( "skopeo" ) . arg ( "--version" ) . output ( ) ?;
695
695
let st = o. status ;
696
696
if !st. success ( ) {
697
+ let _ = std:: io:: copy ( & mut std:: io:: Cursor :: new ( o. stderr ) , & mut std:: io:: stderr ( ) ) ; // Ignore errors copying stderr
697
698
anyhow:: bail!( "Failed to run skopeo --version: {st:?}" ) ;
698
699
}
699
700
let stdout = String :: from_utf8 ( o. stdout ) . context ( "Parsing skopeo version" ) ?;
You can’t perform that action at this time.
0 commit comments