-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Adding resolver entries to streamhost.erb #1407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please
- explain in your pull request or commit messages, what that means, and what impact it has
- add spec tests… should the code you're modifying be already tested in some way…
I have updated the PR description with details as to what this fixes. |
we should first merge #1398 |
or alternatively, this one #1408 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. Could you remove the redundant casting though?
Would you be able to add a test to spec/defines/resource_stream_spec.rb? |
templates/streamhost/streamhost.erb
Outdated
@@ -18,7 +18,7 @@ server { | |||
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>; | |||
<%- end -%> | |||
<%- end -%> | |||
<%- if Array(@resolver).count > 0 -%> | |||
<%- unless @resolver.empty -%> | |||
resolver <% Array(@resolver).each do |res| %> <%= res %><% end %>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
casting is redundant here too.
templates/streamhost/streamhost.erb
Outdated
@@ -18,6 +18,9 @@ server { | |||
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>; | |||
<%- end -%> | |||
<%- end -%> | |||
<%- unless @resolver.empty -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! There was a slight typo in what I told you.
<%- unless @resolver.empty -%> | |
<%- unless @resolver.empty? -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and that's why the tests are failing (and also why tests are great to have!) :)
spec/defines/resource_stream_spec.rb
Outdated
value: ['8.8.8.8', '8.8.4.4'], | ||
match: %r{\s+resolver\s+8.8.8.8 8.8.4.4;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always a fan of using RFC5735 IPs.
Name | Range |
---|---|
TEST-NET-1 | 192.0.2.0/24 |
TEST-NET-2 | 198.51.100.0/24 |
TEST-NET-3 | 203.0.113.0/24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can't believe no one's tried to abolish and sell these yet
…ts]-[SMK] [Correcting typo]-[SMK] [Removing redundant casting as requested]-[SMK] Co-authored-by: Alexander Fisher <[email protected]> [Removing additional casting]-[SMK] [Adding tests for resolvers]-[SMK] [Correcting typo in the Template testing array is empty and changing IPs to RFC5735]-[SMK]
@smkillen Thanks! |
No problem, thanks for the input and for accepting ;-)
…On Sun, 30 Aug 2020 at 17:41, Alexander Fisher ***@***.***> wrote:
@smkillen <https://github.com/smkillen> Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1407 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD22QRY3KKDAL2QU4FOOEJTSDJ6KTANCNFSM4QNBIDAA>
.
|
Adding resolver entries to streamhost.erb
Pull Request (PR) description
When declaring nginx::resource::streamhost, there is the ability to add a "resolver" option, but this is not actually honoured in the configuration, a section to test the existence of that Variable and define it in the configuration erb file is needed.
should create a file in /etc/nginx/conf.stream.d/XXX-test.conf
which contains
but currently does not, this code ensures this entry is present.
This Pull Request (PR) fixes the following issues
When declaring the parameter resolver as per
for a streamhost, nothing is actually configured.