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

Fix use of include_files in nginx::resource::map #1613

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

smortex
Copy link
Member

@smortex smortex commented Sep 10, 2024

When passing some include_files but no mappings, catalog compilation fail with the following error message:

Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Method call, max(): Wrong number of arguments need at least one (file: /etc/puppetlabs/code/environments/romain/modules/nginx/templates/conf.d/map.epp, line: 26, column: 48)

Refactoring done in #1575 has introduced this regression.

The test suite already provide optional parameter values for each test
that rely on them, so we do not need to pass them to all tests.

Moreover, some on these changed default values prevent the test suite
from failing because of a regression introduced when refactoring maps.

Remove the default values to trigger the test suite breakage and allow
checking that a fix is working as expected.
Only attempt to compute the longest key of mappings when mappings are
actually passed.
@smortex smortex added the bug Something isn't working label Sep 10, 2024
@smortex smortex marked this pull request as ready for review September 10, 2024 05:22
@smortex smortex requested a review from jay7x September 10, 2024 05:23
@smortex smortex merged commit 7d17260 into master Sep 10, 2024
28 checks passed
@smortex smortex deleted the fix-broken-map-with-include_files branch September 10, 2024 06:36
@smortex smortex changed the title Fix usage of include_files in nginx::resource::map Fix use of include_files in nginx::resource::map Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants