Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add no_proxy option #549

Merged
merged 2 commits into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
default['datadog']['web_proxy']['user'] = nil
default['datadog']['web_proxy']['password'] = nil
default['datadog']['web_proxy']['skip_ssl_validation'] = nil # accepted values 'yes' or 'no'
default['datadog']['web_proxy']['no_proxy'] = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a small comment here to mention it's used for Agent v6+ only?


# dogstatsd
default['datadog']['dogstatsd'] = true
Expand Down
5 changes: 5 additions & 0 deletions templates/default/datadog.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if node['datadog']['web_proxy']['host']
user = node['datadog']['web_proxy']['user']
password = node['datadog']['web_proxy']['password']
scheme = ""
no_proxy = node['datadog']['web_proxy']['no_proxy']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you initialize no_proxy to nil outside of this if block


unless host.start_with?('http://') or host.start_with?('https://')
scheme = 'http://'
Expand Down Expand Up @@ -136,6 +137,10 @@ if !http_proxy.nil?
}
end

if !no_proxy.nil?
agent_config['proxy']['no_proxy'] = no_proxy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent_config['proxy'] should be initialized to a hash here, but the logic is a bit brittle. Could you either check that the key is indeed present in agent_config or move this block inside the !http_proxy.nil? conditional above?

end

## Trace agent options ##
apm_config = {
enabled: node['datadog']['enable_trace_agent'],
Expand Down