Skip to content

Add test for apm footer to not apply template if = empty string#381

Merged
truthbk merged 2 commits intoDataDog:masterfrom
rothgar:apm_footer_test
Feb 5, 2018
Merged

Add test for apm footer to not apply template if = empty string#381
truthbk merged 2 commits intoDataDog:masterfrom
rothgar:apm_footer_test

Conversation

@rothgar
Copy link
Copy Markdown
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.

Comment thread manifests/init.pp Outdated
target => '/etc/dd-agent/datadog.conf',
content => template('datadog_agent/datadog_apm_footer.conf.erb'),
order => $apm_footer_order,
if $apm_env != '' {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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