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

Accept instances hashes on apache and http_check integrations #691

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

asenci
Copy link
Contributor

@asenci asenci commented Mar 9, 2021

What does this PR do?

This allows more options to be passed directly to the configuration template, without needing to update the module every time a new option is implemented while keeping it backwards compatible with the current style of parameters.

This also removes one test case from http_check: with headers parameter array (I couldn't find a use case for this on the Datadog integration documentation or code).

Motivation

Using the current method of passing options as parameters to the Puppet module requires a module update every time a new option is added to the Datadog agent integration.

Additional Notes

Describe your test plan

Test cases included on the respective spec files

@asenci asenci requested a review from a team as a code owner March 9, 2021 22:25
@albertvaka
Copy link
Contributor

Looking at the tests, there's something in this PR that Puppet 4.6 doesn't like.

Copy link
Contributor

@albertvaka albertvaka left a comment

Choose a reason for hiding this comment

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

I spent a bit of time trying to debug the crash on Puppet 4.6 and I managed to track it down to this change which was added in Puppet 4.9.4: puppetlabs/puppet@6bc88d1

Without this change, it fails with undefined method instance?' for nil:NilClass` but I'm not sure why. Maybe it's a good excuse to drop support for Puppet 4.6? :)

manifests/integrations/http_check.pp Outdated Show resolved Hide resolved
manifests/integrations/http_check.pp Outdated Show resolved Hide resolved
manifests/integrations/http_check.pp Outdated Show resolved Hide resolved
# Conflicts:
#	manifests/integrations/http_check.pp
#	templates/agent-conf.d/http_check.yaml.erb
@albertvaka
Copy link
Contributor

@asenci I see some activity in your branch :) Do you think you could fix the failing tests on puppet 4.6? Then we could merge this to main.

@asenci
Copy link
Contributor Author

asenci commented Feb 4, 2022

@asenci I see some activity in your branch :) Do you think you could fix the failing tests on puppet 4.6? Then we could merge this to main.

Sorry for the lack of feedback, we were down a team member for a while and I didn't have much time to work on this.
I'll try to get this sorted by next week. 👍

@asenci asenci force-pushed the asenci/instances-hash branch 7 times, most recently from 3a72b27 to da09c61 Compare February 18, 2022 05:53
@asenci asenci force-pushed the asenci/instances-hash branch 2 times, most recently from 2ce39af to f06b9d4 Compare February 19, 2022 06:02
@asenci
Copy link
Contributor Author

asenci commented Feb 19, 2022

Hi @albertvaka, I tried everything I could think of, but I couldn't make it work with Puppet 4.6.

It seems to be some weird interaction with the test cases when spec_helper tries to check the resulting file. It passes the tests if you disable some specific checks on datadog_agent_integrations_http_check_spec.rb (mostly related to empty tag testing), but I wasn't able to progress any further with the troubleshooting.

Not sure if there is anything else you would like to try, or if you'd prefer to close the PR?

@albertvaka
Copy link
Contributor

A thousand thanks for all the tests you made, I could see the commits on my Github notifications 🙇 🙇 🙇

I think this change is good and important, so if that's fine for you, let's keep the PR open until either we drop support for 4.6 or someone can help solve the problem on that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants