Fix ceph-dashboard SAML tests
This patchset fixes a couple of issues with ceph-dashboard's SAML support, mostly with outdated bundle configuration. Change-Id: I6c3f8ffdf10d42f9a5280d7e429a7ae64612a139 func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/762
This commit is contained in:
16
osci.yaml
16
osci.yaml
@@ -1,21 +1,13 @@
|
|||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- charm-unit-jobs-py38
|
- charm-unit-jobs-py38
|
||||||
- charm-unit-jobs-py39
|
- charm-unit-jobs-py310
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- focal-octopus
|
- focal-yoga
|
||||||
|
- jammy-yoga:
|
||||||
|
voting: false
|
||||||
vars:
|
vars:
|
||||||
needs_charm_build: true
|
needs_charm_build: true
|
||||||
charm_build_name: ceph-dashboard
|
charm_build_name: ceph-dashboard
|
||||||
build_type: charmcraft
|
build_type: charmcraft
|
||||||
- job:
|
|
||||||
name: focal-octopus
|
|
||||||
parent: func-target
|
|
||||||
dependencies:
|
|
||||||
- charm-build
|
|
||||||
- osci-lint
|
|
||||||
- tox-py38
|
|
||||||
- tox-py39
|
|
||||||
vars:
|
|
||||||
tox_extra_args: focal
|
|
||||||
|
|||||||
26
src/charm.py
26
src/charm.py
@@ -14,7 +14,6 @@ from ops.framework import StoredState
|
|||||||
from ops.main import main
|
from ops.main import main
|
||||||
from ops.model import ActiveStatus, BlockedStatus, StatusBase
|
from ops.model import ActiveStatus, BlockedStatus, StatusBase
|
||||||
from ops.charm import ActionEvent
|
from ops.charm import ActionEvent
|
||||||
from ops_openstack.core import charm_class, get_charm_class_for_release
|
|
||||||
from typing import List, Union, Tuple
|
from typing import List, Union, Tuple
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
@@ -47,7 +46,7 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
"""Ceph Dashboard charm."""
|
"""Ceph Dashboard charm."""
|
||||||
|
|
||||||
_stored = StoredState()
|
_stored = StoredState()
|
||||||
PACKAGES = ['ceph-mgr-dashboard']
|
PACKAGES = ['ceph-mgr-dashboard', 'python3-onelogin-saml2']
|
||||||
CEPH_CONFIG_PATH = Path('/etc/ceph')
|
CEPH_CONFIG_PATH = Path('/etc/ceph')
|
||||||
TLS_KEY_PATH = CEPH_CONFIG_PATH / 'ceph-dashboard.key'
|
TLS_KEY_PATH = CEPH_CONFIG_PATH / 'ceph-dashboard.key'
|
||||||
TLS_PUB_KEY_PATH = CEPH_CONFIG_PATH / 'ceph-dashboard-pub.key'
|
TLS_PUB_KEY_PATH = CEPH_CONFIG_PATH / 'ceph-dashboard-pub.key'
|
||||||
@@ -426,7 +425,6 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
ceph_utils.mgr_enable_dashboard()
|
ceph_utils.mgr_enable_dashboard()
|
||||||
self._apply_ceph_config_from_charm_config()
|
self._apply_ceph_config_from_charm_config()
|
||||||
self._configure_tls()
|
self._configure_tls()
|
||||||
self._configure_saml()
|
|
||||||
ceph_utils.mgr_config_set(
|
ceph_utils.mgr_config_set(
|
||||||
'mgr/dashboard/{hostname}/server_addr'.format(
|
'mgr/dashboard/{hostname}/server_addr'.format(
|
||||||
hostname=socket.gethostname()),
|
hostname=socket.gethostname()),
|
||||||
@@ -452,6 +450,8 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
self._run_cmd([
|
self._run_cmd([
|
||||||
'ceph', 'dashboard', 'set-prometheus-api-host',
|
'ceph', 'dashboard', 'set-prometheus-api-host',
|
||||||
prometheus_ep])
|
prometheus_ep])
|
||||||
|
self._configure_saml()
|
||||||
|
|
||||||
self._register_dashboards()
|
self._register_dashboards()
|
||||||
self._manage_radosgw()
|
self._manage_radosgw()
|
||||||
self._manage_iscsigw()
|
self._manage_iscsigw()
|
||||||
@@ -571,9 +571,6 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
self.kick_dashboard()
|
self.kick_dashboard()
|
||||||
|
|
||||||
def _configure_saml(self) -> None:
|
def _configure_saml(self) -> None:
|
||||||
if 'python3-onelogin-saml2' not in self.PACKAGES:
|
|
||||||
return
|
|
||||||
|
|
||||||
base_url = self.config.get('saml-base-url')
|
base_url = self.config.get('saml-base-url')
|
||||||
idp_metadata = self.config.get('saml-idp-metadata')
|
idp_metadata = self.config.get('saml-idp-metadata')
|
||||||
if not base_url or not idp_metadata:
|
if not base_url or not idp_metadata:
|
||||||
@@ -626,20 +623,5 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
event.fail(exc.output)
|
event.fail(exc.output)
|
||||||
|
|
||||||
|
|
||||||
@charm_class
|
|
||||||
class CephDashboardCharmOctopus(CephDashboardCharm):
|
|
||||||
|
|
||||||
_stored = StoredState()
|
|
||||||
release = 'octopus'
|
|
||||||
|
|
||||||
|
|
||||||
@charm_class
|
|
||||||
class CephDashboardCharmQuincy(CephDashboardCharm):
|
|
||||||
|
|
||||||
_stored = StoredState()
|
|
||||||
PACKAGES = ['ceph-mgr-dashboard', 'python3-onelogin-saml2']
|
|
||||||
release = 'quincy'
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(get_charm_class_for_release())
|
main(CephDashboardCharm)
|
||||||
|
|||||||
@@ -37,9 +37,8 @@ applications:
|
|||||||
charm: ../../ceph-dashboard.charm
|
charm: ../../ceph-dashboard.charm
|
||||||
options:
|
options:
|
||||||
public-hostname: 'ceph-dashboard.zaza.local'
|
public-hostname: 'ceph-dashboard.zaza.local'
|
||||||
source: *openstack-origin
|
|
||||||
prometheus:
|
prometheus:
|
||||||
charm: cs:prometheus2
|
charm: ch:prometheus2
|
||||||
num_units: 1
|
num_units: 1
|
||||||
grafana:
|
grafana:
|
||||||
# SSL and allow_embedding are not released into cs:grafana yet, due
|
# SSL and allow_embedding are not released into cs:grafana yet, due
|
||||||
@@ -57,7 +56,7 @@ applications:
|
|||||||
options:
|
options:
|
||||||
hostname: "{host}"
|
hostname: "{host}"
|
||||||
prometheus-alertmanager:
|
prometheus-alertmanager:
|
||||||
charm: cs:prometheus-alertmanager
|
charm: ch:prometheus-alertmanager
|
||||||
num_units: 1
|
num_units: 1
|
||||||
ceph-radosgw:
|
ceph-radosgw:
|
||||||
charm: ch:ceph-radosgw
|
charm: ch:ceph-radosgw
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ applications:
|
|||||||
options:
|
options:
|
||||||
public-hostname: 'ceph-dashboard.zaza.local'
|
public-hostname: 'ceph-dashboard.zaza.local'
|
||||||
prometheus:
|
prometheus:
|
||||||
charm: cs:prometheus2
|
charm: ch:prometheus2
|
||||||
num_units: 1
|
num_units: 1
|
||||||
|
series: focal
|
||||||
grafana:
|
grafana:
|
||||||
# SSL and allow_embedding are not released into cs:grafana yet, due
|
# SSL and allow_embedding are not released into cs:grafana yet, due
|
||||||
# Octrober 2021
|
# Octrober 2021
|
||||||
@@ -44,14 +45,15 @@ applications:
|
|||||||
install_plugins: https://storage.googleapis.com/plugins-community/vonage-status-panel/release/1.0.11/vonage-status-panel-1.0.11.zip,https://storage.googleapis.com/plugins-community/grafana-piechart-panel/release/1.6.2/grafana-piechart-panel-1.6.2.zip
|
install_plugins: https://storage.googleapis.com/plugins-community/vonage-status-panel/release/1.0.11/vonage-status-panel-1.0.11.zip,https://storage.googleapis.com/plugins-community/grafana-piechart-panel/release/1.6.2/grafana-piechart-panel-1.6.2.zip
|
||||||
install_method: snap
|
install_method: snap
|
||||||
allow_embedding: True
|
allow_embedding: True
|
||||||
telegraf:
|
#telegraf:
|
||||||
charm: telegraf
|
# charm: telegraf
|
||||||
channel: stable
|
# channel: stable
|
||||||
options:
|
# options:
|
||||||
hostname: "{host}"
|
# hostname: "{host}"
|
||||||
prometheus-alertmanager:
|
prometheus-alertmanager:
|
||||||
charm: cs:prometheus-alertmanager
|
charm: ch:prometheus-alertmanager
|
||||||
num_units: 1
|
num_units: 1
|
||||||
|
series: focal
|
||||||
ceph-radosgw:
|
ceph-radosgw:
|
||||||
charm: ch:ceph-radosgw
|
charm: ch:ceph-radosgw
|
||||||
num_units: 3
|
num_units: 3
|
||||||
@@ -83,14 +85,14 @@ relations:
|
|||||||
- 'prometheus:grafana-source'
|
- 'prometheus:grafana-source'
|
||||||
- - 'grafana:certificates'
|
- - 'grafana:certificates'
|
||||||
- 'vault:certificates'
|
- 'vault:certificates'
|
||||||
- - 'ceph-osd:juju-info'
|
#- - 'ceph-osd:juju-info'
|
||||||
- 'telegraf:juju-info'
|
#- 'telegraf:juju-info'
|
||||||
- - 'ceph-mon:juju-info'
|
#- - 'ceph-mon:juju-info'
|
||||||
- 'telegraf:juju-info'
|
# - 'telegraf:juju-info'
|
||||||
- - 'telegraf:prometheus-client'
|
#- - 'telegraf:prometheus-client'
|
||||||
- 'prometheus:target'
|
# - 'prometheus:target'
|
||||||
- - 'telegraf:dashboards'
|
#- - 'telegraf:dashboards'
|
||||||
- 'grafana:dashboards'
|
# - 'grafana:dashboards'
|
||||||
- - 'ceph-dashboard:grafana-dashboard'
|
- - 'ceph-dashboard:grafana-dashboard'
|
||||||
- 'grafana:dashboards'
|
- 'grafana:dashboards'
|
||||||
- - 'ceph-dashboard:alertmanager-service'
|
- - 'ceph-dashboard:alertmanager-service'
|
||||||
Reference in New Issue
Block a user