mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
Route proxy-network traffic through HTTP_PROXY and HTTPS_PROXY from the buildkitd environment. Propagate ALL_PROXY to gateway execs and document upstream proxy behavior. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
24 lines
535 B
Go
24 lines
535 B
Go
package network
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFilterProxyEnv(t *testing.T) {
|
|
require.Equal(t, []string{
|
|
"HTTP_PROXY=http://buildkit-proxy",
|
|
"ALL_PROXY=http://initial-process-proxy",
|
|
"all_proxy=http://initial-process-proxy",
|
|
"NO_PROXY=localhost",
|
|
}, FilterProxyEnv([]string{
|
|
"PATH=/usr/bin",
|
|
"HTTP_PROXY=http://buildkit-proxy",
|
|
"FTP_PROXY=http://ftp-proxy",
|
|
"ALL_PROXY=http://initial-process-proxy",
|
|
"all_proxy=http://initial-process-proxy",
|
|
"NO_PROXY=localhost",
|
|
}))
|
|
}
|