File tree 2 files changed +3
-7
lines changed
2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -609,7 +609,8 @@ pub struct Spec {
609
609
impl Spec {
610
610
pub fn load < P : AsRef < Path > > ( path : P ) -> Result < Self > {
611
611
let path = path. as_ref ( ) ;
612
- let file = File :: open ( path) . with_context ( || format ! ( "failed to open {:?}" , path) ) ?;
612
+ let file =
613
+ File :: open ( path) . with_context ( || format ! ( "load spec: failed to open {:?}" , path) ) ?;
613
614
let spec: Spec = serde_json:: from_reader ( & file) ?;
614
615
Ok ( spec)
615
616
}
Original file line number Diff line number Diff line change 1
1
use std:: fs;
2
- use std:: path:: Path ;
3
2
use std:: path:: PathBuf ;
4
3
5
4
use anyhow:: { bail, Result } ;
@@ -42,11 +41,7 @@ impl Delete {
42
41
log:: debug!( "container status: {:?}" , container. status( ) ) ;
43
42
if container. can_delete ( ) {
44
43
if container. root . exists ( ) {
45
- nix:: unistd:: chdir ( & PathBuf :: from ( & container. state . bundle ) ) ?;
46
- let config_absolute_path = & PathBuf :: from ( & container. state . bundle )
47
- . join ( Path :: new ( "config.json" ) )
48
- . to_string_lossy ( )
49
- . to_string ( ) ;
44
+ let config_absolute_path = container. root . join ( "config.json" ) ;
50
45
log:: debug!( "load spec from {:?}" , config_absolute_path) ;
51
46
let spec = oci_spec:: Spec :: load ( config_absolute_path) ?;
52
47
log:: debug!( "spec: {:?}" , spec) ;
You can’t perform that action at this time.
0 commit comments