Merge ~pjdc/charm-k8s-mattermost/+git/charm-k8s-mattermost:siteurl into charm-k8s-mattermost:master

Proposed by Paul Collins
Status: Merged
Approved by: Paul Collins
Approved revision: 4ffbd62389a2c4b25eadfd3e0b16a51e9a28607e
Merged at revision: 7ad6219bac991f15391b16d8392bf8c3596c143f
Proposed branch: ~pjdc/charm-k8s-mattermost/+git/charm-k8s-mattermost:siteurl
Merge into: charm-k8s-mattermost:master
Prerequisite: ~pjdc/charm-k8s-mattermost/+git/charm-k8s-mattermost:psql-relation
Diff against target: 49 lines (+18/-5)
2 files modified
config.yaml (+7/-0)
src/charm.py (+11/-5)
Reviewer Review Type Date Requested Status
Paul Collins me Approve
Stuart Bishop (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+384512@code.launchpad.net

Commit message

add site_url and wire it up

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
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Paul Collins (pjdc) wrote :

Note prereq.

Revision history for this message
Stuart Bishop (stub) wrote :

Seems fine. Maybe the site_url option should be required, rather than 'optional but required if you want things to actually work'?

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

Merge proposal is approved, but source revision has changed, setting status to needs review.

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

Change successfully merged at revision 7ad6219bac991f15391b16d8392bf8c3596c143f

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/config.yaml b/config.yaml
index 603ba30..733c53d 100644
--- a/config.yaml
+++ b/config.yaml
@@ -7,3 +7,10 @@ options:
7 type: boolean7 type: boolean
8 description: Allows users to sign up from the root page without an invite8 description: Allows users to sign up from the root page without an invite
9 default: false9 default: false
10 site_url:
11 type: string
12 description: |
13 The URL by which the site is reached. This must be set for all of Mattermost's features to work correctly.
14
15 For more information, see https://docs.mattermost.com/administration/config-settings.html#site-url
16 default: ''
diff --git a/src/charm.py b/src/charm.py
index 0fcc304..230651c 100755
--- a/src/charm.py
+++ b/src/charm.py
@@ -110,6 +110,16 @@ class MattermostK8sCharm(CharmBase):
110 mattermost_image_details = self.mattermost_image.fetch()110 mattermost_image_details = self.mattermost_image.fetch()
111 self.model.unit.status = MaintenanceStatus('Configuring pod')111 self.model.unit.status = MaintenanceStatus('Configuring pod')
112 config = self.model.config112 config = self.model.config
113
114 pod_config = {
115 'MATTERMOST_HTTPD_LISTEN_PORT': int(config['mattermost_port']),
116 'MM_SQLSETTINGS_DATASOURCE': self.state.db_uri,
117 'MM_ENABLEOPENSERVER': config['open_server'],
118 }
119
120 if config['site_url']:
121 pod_config['MM_SERVICESETTINGS_SITEURL'] = config['site_url']
122
113 self.model.pod.set_spec({123 self.model.pod.set_spec({
114 'containers': [{124 'containers': [{
115 'name': self.framework.model.app.name,125 'name': self.framework.model.app.name,
@@ -118,11 +128,7 @@ class MattermostK8sCharm(CharmBase):
118 'containerPort': int(self.framework.model.config['mattermost_port']),128 'containerPort': int(self.framework.model.config['mattermost_port']),
119 'protocol': 'TCP',129 'protocol': 'TCP',
120 }],130 }],
121 'config': {131 'config': pod_config,
122 'MATTERMOST_HTTPD_LISTEN_PORT': int(config['mattermost_port']),
123 'MM_SQLSETTINGS_DATASOURCE': self.state.db_uri,
124 'MM_ENABLEOPENSERVER': config['open_server'],
125 },
126 }]132 }]
127 })133 })
128 self.state.is_started = True134 self.state.is_started = True

Subscribers

People subscribed via source and target branches