@@ -40,6 +40,9 @@ type tinkConfig struct {
4040
4141 // tinkServerTLS is whether or not to use TLS for tink-server communication.
4242 tinkServerTLS string
43+ httpProxy string
44+ httpsProxy string
45+ noProxy string
4346}
4447
4548const maxRetryAttempts = 20
@@ -83,6 +86,9 @@ func main() {
8386 fmt .Sprintf ("TINKERBELL_TLS=%s" , cfg .tinkServerTLS ),
8487 fmt .Sprintf ("WORKER_ID=%s" , cfg .workerID ),
8588 fmt .Sprintf ("ID=%s" , cfg .workerID ),
89+ fmt .Sprintf ("HTTP_PROXY=%s" , cfg .httpProxy ),
90+ fmt .Sprintf ("HTTPS_PROXY=%s" , cfg .httpsProxy ),
91+ fmt .Sprintf ("NO_PROXY=%s" , cfg .noProxy ),
8692 },
8793 AttachStdout : true ,
8894 AttachStderr : true ,
@@ -126,6 +132,10 @@ func main() {
126132 time .Sleep (time .Second * 3 )
127133 fmt .Println ("Starting Communication with Docker Engine" )
128134
135+ os .Setenv ("HTTP_PROXY" , cfg .httpProxy )
136+ os .Setenv ("HTTPS_PROXY" , cfg .httpsProxy )
137+ os .Setenv ("NO_PROXY" , cfg .noProxy )
138+
129139 // Create Docker client with API (socket)
130140 ctx := context .Background ()
131141 cli , err := client .NewClientWithOpts (client .FromEnv , client .WithAPIVersionNegotiation ())
@@ -204,6 +214,12 @@ func parseCmdLine(cmdLines []string) (cfg tinkConfig) {
204214 cfg .tinkWorkerImage = cmdLine [1 ]
205215 case "tinkerbell_tls" :
206216 cfg .tinkServerTLS = cmdLine [1 ]
217+ case "HTTP_PROXY" :
218+ cfg .httpProxy = cmdLine [1 ]
219+ case "HTTPS_PROXY" :
220+ cfg .httpsProxy = cmdLine [1 ]
221+ case "NO_PROXY" :
222+ cfg .noProxy = cmdLine [1 ]
207223 }
208224 }
209225 return cfg
0 commit comments