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 test for apm footer to not apply template if = empty string #381

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

rothgar
Copy link
Contributor

@rothgar rothgar commented Jan 5, 2018

This causes an error on nodes that don't have an apm footer set. The default value is an empty string and tests between puppet 3 and puppet 4 are different.
Explicitly testing for an empty string to know if we should create the template.

target => '/etc/dd-agent/datadog.conf',
content => template('datadog_agent/datadog_apm_footer.conf.erb'),
order => $apm_footer_order,
if $apm_env != '' {
Copy link
Member

Choose a reason for hiding this comment

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

would it maybe make more sense to check for $apm_enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense but if apm_enabled == true but apm_env is not set then you would still get an error.

I could add a check for both so long as we think the user will know they need to set both variables to have it configured.

@truthbk truthbk added this to the 2.0.0 milestone Jan 31, 2018
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍

Tests break as a consequence of these changes but since I'm working on a few things currently I'll make sure we get them fixed ASAP.

Thank you! 🙇

@truthbk truthbk merged commit 9988121 into DataDog:master Feb 5, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-datadog_agent that referenced this pull request Apr 6, 2020
Add test for apm footer to not apply template if = empty string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants