@@ -29,6 +29,7 @@ var opts struct {
29
29
BinDir string
30
30
AutoInstall bool
31
31
UserAccessibleSocket bool
32
+ Verbose bool
32
33
}
33
34
34
35
func main () {
@@ -37,15 +38,15 @@ func main() {
37
38
log .WithError (err ).Fatal ()
38
39
}
39
40
40
- verbose := pflag .BoolP ( "verbose" , "v" , false , "enables verbose logging" )
41
+ pflag .BoolVarP ( & opts . Verbose , "verbose" , "v" , false , "enables verbose logging" )
41
42
pflag .BoolVar (& opts .RuncFacade , "runc-facade" , true , "enables the runc-facade to handle rootless idiosyncrasies" )
42
43
pflag .StringVar (& opts .BinDir , "bin-dir" , filepath .Dir (self ), "directory where runc-facade and slirp-docker-proxy are found" )
43
44
pflag .BoolVar (& opts .AutoInstall , "auto-install" , true , "auto-install prerequisites (docker, slirp4netns)" )
44
45
pflag .BoolVar (& opts .UserAccessibleSocket , "user-accessible-socket" , true , "chmod the Docker socket to make it user accessible" )
45
46
pflag .Parse ()
46
47
47
48
logger := logrus .New ()
48
- if * verbose {
49
+ if opts . Verbose {
49
50
logger .SetLevel (logrus .DebugLevel )
50
51
}
51
52
@@ -90,6 +91,11 @@ func runWithinNetns() (err error) {
90
91
"--data-root=/workspace/.docker-root" ,
91
92
"--userland-proxy" , "--userland-proxy-path=" + filepath .Join (opts .BinDir , "slirp-docker-proxy" ),
92
93
}
94
+ if opts .Verbose {
95
+ args = append (args ,
96
+ "--log-level" , "debug" ,
97
+ )
98
+ }
93
99
if opts .RuncFacade {
94
100
args = append (args ,
95
101
"--add-runtime" , "gitpod=" + filepath .Join (opts .BinDir , "runc-facade" ),
0 commit comments