Commit c2860219 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Run kedifa-updater once on each partition run

Each time new slave appears the kedifa-updater has to be run immediately, in
order for certificates to be properly setup.

Otherwise caddy can be left in non-runnable state until next kedifa-updater
would run again.
parent 9f334fb6
...@@ -30,7 +30,7 @@ md5sum = d62aefe002ec13875924e4c219914795 ...@@ -30,7 +30,7 @@ md5sum = d62aefe002ec13875924e4c219914795
[template-slave-list] [template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = 75439cb035393e68c73672b224bead54 md5sum = 57f562311bac6dbf85cd35891eaa6743
[template-slave-configuration] [template-slave-configuration]
filename = templates/custom-virtualhost.conf.in filename = templates/custom-virtualhost.conf.in
......
...@@ -442,6 +442,13 @@ command-line = {{ kedifa_updater }} ...@@ -442,6 +442,13 @@ command-line = {{ kedifa_updater }}
wrapper-path = {{ service_directory }}/kedifa-updater wrapper-path = {{ service_directory }}/kedifa-updater
hash-files = ${buildout:directory}/software_release/buildout.cfg hash-files = ${buildout:directory}/software_release/buildout.cfg
[kedifa-updater-run]
recipe = plone.recipe.command
# unfortunately slapos.cookbook:wrapper does not return generated wrapper path
# so it is needed to access it via service directory globbing
command = {{ service_directory }}/kedifa-updater* --once
update-command = ${:command}
[kedifa-updater-mapping] [kedifa-updater-mapping]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
file = {{ kedifa_updater_mapping_file }} file = {{ kedifa_updater_mapping_file }}
...@@ -466,6 +473,7 @@ extends = ...@@ -466,6 +473,7 @@ extends =
parts += parts +=
kedifa-updater kedifa-updater
kedifa-updater-run
caddy-log-access-header caddy-log-access-header
{% for part in part_list %} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
......
...@@ -744,7 +744,6 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -744,7 +744,6 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
# run partition for slaves to be setup # run partition for slaves to be setup
cls.runComputerPartitionUntil( cls.runComputerPartitionUntil(
cls.untilSlavePartitionReady) cls.untilSlavePartitionReady)
cls.runKedifaUpdater()
# run once more slapos node instance, as kedifa-updater sets up # run once more slapos node instance, as kedifa-updater sets up
# certificates needed for caddy-frontend, and on this moment it can be # certificates needed for caddy-frontend, and on this moment it can be
# not started yet # not started yet
...@@ -5532,7 +5531,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate( ...@@ -5532,7 +5531,6 @@ class TestSlaveSlapOSMasterCertificateCompatibilityUpdate(
}) })
self.runComputerPartition(max_quantity=1) self.runComputerPartition(max_quantity=1)
self.runKedifaUpdater()
result = self.fakeHTTPSResult( result = self.fakeHTTPSResult(
parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path') parameter_dict['domain'], parameter_dict['public-ipv4'], 'test-path')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment