Skip to content

Commit

Permalink
Make "no_advertise" cluster property configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ameowlia authored and psycofdj committed Oct 14, 2020
1 parent ccd5eb3 commit b8c113d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions jobs/nats-tls/spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ properties:
nats.prof_port:
description: "Port for pprof. 0 means disabled."
default: 0
nats.no_advertise:
description: "When configured to true, this nats server will not be advertised to any nats clients."
default: true

nats.external.tls.ca:
description: "Certificate of the CA for publisher/subscriber traffic. In PEM format."
Expand Down
2 changes: 1 addition & 1 deletion jobs/nats-tls/templates/nats-tls.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ tls {
}

cluster {
no_advertise: true
no_advertise: <%= p("nats.no_advertise") %>
host: "<%= p("nats.cluster_host", spec.address) %>"
port: <%= p("nats.cluster_port") %>

Expand Down
4 changes: 3 additions & 1 deletion jobs/nats/spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ properties:
nats.prof_port:
description: "Port for pprof. 0 means disabled."
default: 0

nats.no_advertise:
description: "When configured to true, this nats server will not be advertised to any nats clients. This is defaulted to true for backwards compatability."
default: true
nats.internal.tls.enabled:
description: "Enable mutually authenticated TLS for NATS cluster-internal traffic."
default: false
Expand Down
2 changes: 1 addition & 1 deletion jobs/nats/templates/nats.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ authorization {
}

cluster {
no_advertise: true
no_advertise: <%= p("nats.no_advertise") %>
host: "<%= p("nats.cluster_host", spec.address) %>"
port: <%= p("nats.cluster_port") %>

Expand Down
3 changes: 3 additions & 0 deletions spec/nats-tls/nats_tls_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Bosh::Template::Test
'cluster_port' => 4223,
'authorization_timeout' => 15,
'machines' => nil,
'no_advertise' => false,
'debug' => false,
'trace' => false,
'monitor_port' => 0,
Expand Down Expand Up @@ -110,6 +111,7 @@ module Bosh::Template::Test
\}
cluster \{
no_advertise: false
host: "10.0.0.1"
port: 4223
Expand Down Expand Up @@ -186,6 +188,7 @@ module Bosh::Template::Test
\}
cluster \{
no_advertise: false
host: "10.0.0.1"
port: 4223
Expand Down
3 changes: 3 additions & 0 deletions spec/nats/nats_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Bosh::Template::Test
'cluster_port' => 4223,
'authorization_timeout' => 15,
'machines' => nil,
'no_advertise' => true,
'debug' => false,
'trace' => false,
'monitor_port' => 0,
Expand Down Expand Up @@ -88,6 +89,7 @@ module Bosh::Template::Test
\}
cluster \{
no_advertise: true
host: "10.0.0.1"
port: 4223
Expand Down Expand Up @@ -149,6 +151,7 @@ module Bosh::Template::Test
\}
cluster \{
no_advertise: true
host: "10.0.0.1"
port: 4223
Expand Down

0 comments on commit b8c113d

Please sign in to comment.