File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ impl IsolatedContainerAPI {
116116 . create_vm (
117117 id,
118118 2 ,
119- 4294967296 ,
119+ // TODO make configurable through container request
120+ 536870912 ,
120121 vm:: BootMode :: KernelBoot ( vm:: KernelBootMode {
121122 kernel : PathBuf :: from ( "/usr/share/feos/vmlinuz" ) ,
122123 initramfs : PathBuf :: from ( "/usr/share/feos/initramfs" ) ,
@@ -205,8 +206,16 @@ impl IsolatedContainerService for IsolatedContainerAPI {
205206 image : request. get_ref ( ) . image . to_string ( ) ,
206207 command : request. get_ref ( ) . command . clone ( ) ,
207208 } ) ;
208- let response = client. create_container ( request) . await ?;
209- println ! ( "{}" , response. get_ref( ) . uuid) ;
209+ let response = client
210+ . create_container ( request)
211+ . await
212+ . map_err ( |_| match self . vmm . kill_vm ( id) {
213+ Ok ( _) => Error :: Error ( "failed to create container" . to_string ( ) ) ,
214+ Err ( e) => Error :: Error ( format ! ( "failed to create container: {:?}" , e) ) ,
215+ } )
216+ . map_err ( |e| self . handle_error ( e) ) ?;
217+
218+ info ! ( "created container with id: {}" , response. get_ref( ) . uuid) ;
210219
211220 let container_id = Uuid :: parse_str ( & response. get_ref ( ) . uuid )
212221 . map_err ( |_| Error :: InvalidID )
You can’t perform that action at this time.
0 commit comments