11package  main
22
33import  (
4- 	"github.com/sirupsen/logrus" 
54	"github.com/urfave/cli" 
65)
76
@@ -19,18 +18,16 @@ Use runc list to identify instances of containers and their current status.`,
1918		if  err  :=  checkArgs (context , 1 , exactArgs ); err  !=  nil  {
2019			return  err 
2120		}
22- 		rootlessCg , err  :=  shouldUseRootlessCgroupManager (context )
21+ 		container , err  :=  getContainer (context )
2322		if  err  !=  nil  {
2423			return  err 
2524		}
26- 		if  rootlessCg  {
27- 			logrus .Warnf ("runc pause may fail if you don't have the full access to cgroups" )
28- 		}
29- 		container , err  :=  getContainer (context )
25+ 		err  =  container .Pause ()
3026		if  err  !=  nil  {
27+ 			maybeLogCgroupWarning ("pause" , err )
3128			return  err 
3229		}
33- 		return  container . Pause () 
30+ 		return  nil 
3431	},
3532}
3633
@@ -48,17 +45,15 @@ Use runc list to identify instances of containers and their current status.`,
4845		if  err  :=  checkArgs (context , 1 , exactArgs ); err  !=  nil  {
4946			return  err 
5047		}
51- 		rootlessCg , err  :=  shouldUseRootlessCgroupManager (context )
48+ 		container , err  :=  getContainer (context )
5249		if  err  !=  nil  {
5350			return  err 
5451		}
55- 		if  rootlessCg  {
56- 			logrus .Warn ("runc resume may fail if you don't have the full access to cgroups" )
57- 		}
58- 		container , err  :=  getContainer (context )
52+ 		err  =  container .Resume ()
5953		if  err  !=  nil  {
54+ 			maybeLogCgroupWarning ("resume" , err )
6055			return  err 
6156		}
62- 		return  container . Resume () 
57+ 		return  nil 
6358	},
6459}
0 commit comments