Skip to content

Commit 08d19fd

Browse files
committed
set proxy option for containers
Signed-off-by: Emily McMullan <[email protected]>
1 parent f172a11 commit 08d19fd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmd/analyze.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,19 @@ func (a *analyzeCommand) RunAnalysis(ctx context.Context, volName string) error
11981198
}
11991199
}
12001200

1201+
// Pass proxy settings from command line flags to container
1202+
proxyFlags := map[string]string{
1203+
"HTTP_PROXY": a.httpProxy,
1204+
"HTTPS_PROXY": a.httpsProxy,
1205+
"NO_PROXY": a.noProxy,
1206+
}
1207+
1208+
for envVar, value := range proxyFlags {
1209+
if value != "" {
1210+
containerOpts = append(containerOpts, container.WithEnv(envVar, value))
1211+
}
1212+
}
1213+
12011214
// TODO (pgaikwad): run analysis & deps in parallel
12021215
err = c.Run(ctx, containerOpts...)
12031216
if err != nil {

0 commit comments

Comments
 (0)