Merge ~gtrkiller/charm-k8s-mattermost:master into charm-k8s-mattermost:master

Proposed by Franco Luciano Forneron Buschiazzo
Status: Merged
Approved by: Tom Haddon
Approved revision: c268338fbb68188cdcfbd0a7841c567a5581ac27
Merged at revision: 1d05443a0341919b7db0894676a4fa4e69c0dbd8
Proposed branch: ~gtrkiller/charm-k8s-mattermost:master
Merge into: charm-k8s-mattermost:master
Diff against target: 56 lines (+5/-8)
2 files modified
src/charm.py (+1/-4)
tests/unit/test_charm.py (+4/-4)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+454515@code.launchpad.net

Commit message

rollback sslmode=disable

Description of the change

Even though MM docs suggest otherwise, by just using the --via option when relation postgresql to Mattermost solves the problem.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

Lgtm

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 1d05443a0341919b7db0894676a4fa4e69c0dbd8

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/charm.py b/src/charm.py
2index 7265b84..1b68768 100755
3--- a/src/charm.py
4+++ b/src/charm.py
5@@ -208,10 +208,7 @@ class MattermostK8sCharm(CharmBase):
6 """Return an envConfig with some core configuration."""
7 config = self.model.config
8 # https://github.com/mattermost/mattermost-server/pull/14666
9- # On Mattermost 8.x we should sslmode=disable explicitly in the connection
10- # according to the docs:
11- # https://docs.mattermost.com/configure/database-configuration-settings.html#data-source
12- db_uri = self.state.db_uri.replace('postgresql://', 'postgres://') + '?sslmode=disable'
13+ db_uri = self.state.db_uri.replace('postgresql://', 'postgres://')
14 pod_config = {
15 'MATTERMOST_HTTPD_LISTEN_PORT': CONTAINER_PORT,
16 'MM_CONFIG': db_uri,
17diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
18index dbd9603..6a6888e 100644
19--- a/tests/unit/test_charm.py
20+++ b/tests/unit/test_charm.py
21@@ -149,7 +149,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
22 self.harness.update_config(CONFIG_TEAM)
23 expected = {
24 'MATTERMOST_HTTPD_LISTEN_PORT': 8065,
25- 'MM_CONFIG': 'postgres://10.0.1.101:5432/?sslmode=disable',
26+ 'MM_CONFIG': 'postgres://10.0.1.101:5432/',
27 'MM_IMAGEPROXYSETTINGS_ENABLE': 'false',
28 'MM_IMAGEPROXYSETTINGS_IMAGEPROXYTYPE': 'local',
29 'MM_LOGSETTINGS_CONSOLELEVEL': 'INFO',
30@@ -157,7 +157,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
31 'MM_LOGSETTINGS_ENABLEFILE': 'false',
32 'MM_SERVICESETTINGS_ENABLEGIFPICKER': 'true',
33 'MM_SERVICESETTINGS_SITEURL': 'http://mattermost-k8s',
34- 'MM_SQLSETTINGS_DATASOURCE': 'postgres://10.0.1.101:5432/?sslmode=disable',
35+ 'MM_SQLSETTINGS_DATASOURCE': 'postgres://10.0.1.101:5432/',
36 'MM_TEAMSETTINGS_MAXCHANNELSPERTEAM': 20,
37 'MM_TEAMSETTINGS_MAXUSERSPERTEAM': 30,
38 }
39@@ -245,7 +245,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
40 self.harness.update_config(CONFIG_GFYCAT_API_SNIPPET)
41 expected = {
42 'MATTERMOST_HTTPD_LISTEN_PORT': 8065,
43- 'MM_CONFIG': 'postgres://10.0.1.101:5432/?sslmode=disable',
44+ 'MM_CONFIG': 'postgres://10.0.1.101:5432/',
45 'MM_IMAGEPROXYSETTINGS_ENABLE': 'false',
46 'MM_IMAGEPROXYSETTINGS_IMAGEPROXYTYPE': 'local',
47 'MM_LOGSETTINGS_CONSOLELEVEL': 'INFO',
48@@ -255,7 +255,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
49 'MM_SERVICESETTINGS_GFYCATAPIKEY': EXAMPLE_CONFIG_GFYCAT_API_KEY,
50 'MM_SERVICESETTINGS_GFYCATAPISECRET': EXAMPLE_CONFIG_GFYCAT_API_SECRET,
51 'MM_SERVICESETTINGS_SITEURL': 'http://mattermost-k8s',
52- 'MM_SQLSETTINGS_DATASOURCE': 'postgres://10.0.1.101:5432/?sslmode=disable',
53+ 'MM_SQLSETTINGS_DATASOURCE': 'postgres://10.0.1.101:5432/',
54 'MM_TEAMSETTINGS_MAXCHANNELSPERTEAM': 3000,
55 'MM_TEAMSETTINGS_MAXUSERSPERTEAM': 2000,
56 }

Subscribers

People subscribed via source and target branches