33//! the container/sandbox.
44
55use std:: collections:: HashMap ;
6- use std:: env:: { current_dir, self } ;
6+ use std:: env:: { current_dir} ;
77use std:: fs:: { self , File } ;
88use std:: fs:: { canonicalize, create_dir_all, OpenOptions } ;
99use std:: ops:: Not ;
@@ -14,7 +14,7 @@ use std::sync::{Arc, Condvar, Mutex, RwLock};
1414use std:: thread;
1515
1616use super :: instance:: { EngineGetter , Instance , InstanceConfig , Nop , Wait } ;
17- use super :: { oci, Error , SandboxService , containerd } ;
17+ use super :: { oci, Error , SandboxService } ;
1818use chrono:: { DateTime , Utc } ;
1919use containerd_shim:: {
2020 self as shim, api,
@@ -339,7 +339,6 @@ where
339339 events : Arc < Mutex < EventSender > > ,
340340 exit : Arc < ExitSignal > ,
341341 namespace : String ,
342- containerd_address : Option < String >
343342}
344343
345344#[ cfg( test) ]
@@ -425,7 +424,6 @@ mod localtests {
425424 tx,
426425 Arc :: new ( ExitSignal :: default ( ) ) ,
427426 "test_namespace" . into ( ) ,
428- Some ( "/pipe/to/containerd" . into ( ) ) ,
429427 ) ) ;
430428 let mut _wrapped = LocalWithDescrutor :: new ( local. clone ( ) ) ;
431429
@@ -456,7 +454,6 @@ mod localtests {
456454 etx,
457455 exit_signal,
458456 "test_namespace" . into ( ) ,
459- Some ( "/pipe/to/containerd" . into ( ) ) ,
460457 ) ) ;
461458
462459 let mut _wrapped = LocalWithDescrutor :: new ( local. clone ( ) ) ;
@@ -625,7 +622,6 @@ mod localtests {
625622 etx,
626623 exit_signal,
627624 "test_namespace" . into ( ) ,
628- Some ( "/pipe/to/containerd" . into ( ) ) ,
629625 ) ) ;
630626
631627 let mut _wrapped = LocalWithDescrutor :: new ( local. clone ( ) ) ;
@@ -739,7 +735,6 @@ where
739735 tx : Sender < ( String , Box < dyn Message > ) > ,
740736 exit : Arc < ExitSignal > ,
741737 namespace : String ,
742- containerd_address : Option < String > ,
743738 ) -> Self
744739 where
745740 T : Instance < E = E > + Sync + Send ,
@@ -752,12 +747,11 @@ where
752747 events : Arc :: new ( Mutex :: new ( tx) ) ,
753748 exit,
754749 namespace,
755- containerd_address,
756750 }
757751 }
758752
759753 fn new_base ( & self , id : String ) -> InstanceData < T , E > {
760- let cfg = InstanceConfig :: new ( self . engine . clone ( ) , self . namespace . clone ( ) , self . containerd_address . clone ( ) ) ;
754+ let cfg = InstanceConfig :: new ( self . engine . clone ( ) , self . namespace . clone ( ) ) ;
761755 InstanceData {
762756 instance : None ,
763757 base : Some ( Nop :: new ( id, None ) ) ,
@@ -948,7 +942,7 @@ where
948942 }
949943
950944 let engine = self . engine . clone ( ) ;
951- let mut builder = InstanceConfig :: new ( engine, self . namespace . clone ( ) , self . containerd_address . clone ( ) ) ;
945+ let mut builder = InstanceConfig :: new ( engine, self . namespace . clone ( ) ) ;
952946 builder
953947 . set_stdin ( req. get_stdin ( ) . into ( ) )
954948 . set_stdout ( req. get_stdout ( ) . into ( ) )
@@ -1207,21 +1201,13 @@ where
12071201{
12081202 type Instance = T ;
12091203 fn new ( namespace : String , _id : String , engine : E , publisher : RemotePublisher ) -> Self {
1210-
1211- let os_args: Vec < _ > = env:: args_os ( ) . collect ( ) ;
1212- let containerd_address = match containerd:: parse ( & os_args[ 1 ..] ) {
1213- Ok ( flags) => Some ( flags. address ) ,
1214- _ => None
1215- } ;
1216-
12171204 let ( tx, rx) = channel :: < ( String , Box < dyn Message > ) > ( ) ;
12181205 forward_events ( namespace. clone ( ) , publisher, rx) ;
12191206 Local :: < T , E > :: new (
12201207 engine,
12211208 tx. clone ( ) ,
12221209 Arc :: new ( ExitSignal :: default ( ) ) ,
12231210 namespace,
1224- containerd_address,
12251211 )
12261212 }
12271213}
@@ -1358,7 +1344,6 @@ where
13581344{
13591345 pub engine : E ,
13601346 namespace : String ,
1361- containerd_address : Option < String > ,
13621347 phantom : std:: marker:: PhantomData < T > ,
13631348 exit : Arc < ExitSignal > ,
13641349 _id : String ,
@@ -1373,17 +1358,10 @@ where
13731358
13741359 fn new ( _runtime_id : & str , id : & str , namespace : & str , _config : & mut shim:: Config ) -> Self {
13751360 // Ideally this function passes in either the containerd address or the flags from the cli
1376- let os_args: Vec < _ > = env:: args_os ( ) . collect ( ) ;
1377- let containerd_address = match containerd:: parse ( & os_args[ 1 ..] ) {
1378- Ok ( flags) => Some ( flags. address ) ,
1379- _ => None
1380- } ;
1381-
13821361 Cli {
13831362 engine : I :: new_engine ( ) . unwrap ( ) ,
13841363 phantom : std:: marker:: PhantomData ,
13851364 namespace : namespace. to_string ( ) ,
1386- containerd_address : containerd_address,
13871365 exit : Arc :: new ( ExitSignal :: default ( ) ) ,
13881366 _id : id. to_string ( ) ,
13891367 }
@@ -1507,7 +1485,6 @@ where
15071485 tx. clone ( ) ,
15081486 self . exit . clone ( ) ,
15091487 self . namespace . clone ( ) ,
1510- self . containerd_address . clone ( ) ,
15111488 )
15121489 }
15131490
0 commit comments