diff --git a/pipeline/frontend/yaml/compiler/option.go b/pipeline/frontend/yaml/compiler/option.go index 65d9908f9..d451ef6b4 100644 --- a/pipeline/frontend/yaml/compiler/option.go +++ b/pipeline/frontend/yaml/compiler/option.go @@ -25,6 +25,10 @@ import ( // Option configures a compiler option. type Option func(*Compiler) +func noopOption() Option { + return func(*Compiler) {} +} + // WithOption configures the compiler with the given option if // boolean b evaluates to true. func WithOption(option Option, b bool) Option { @@ -226,6 +230,11 @@ type ProxyOptions struct { // and NO_PROXY environment variables added by default to every // container in the pipeline. func WithProxy(opt ProxyOptions) Option { + if opt.HTTPProxy == "" && + opt.HTTPSProxy == "" && + opt.NoProxy == "" { + return noopOption() + } return WithEnviron( map[string]string{ "no_proxy": opt.NoProxy,