diff --git a/src/charm.py b/src/charm.py index a5d7fc1..4fa7aa0 100755 --- a/src/charm.py +++ b/src/charm.py @@ -415,14 +415,19 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm): "Skipping charm option {}, not supported".format( option.charm_option_name)) - def _configure_dashboard(self, _) -> None: + def _configure_dashboard(self, event) -> None: """Configure dashboard""" self.request_certificates() if not self.mon.mons_ready: logging.info("Not configuring dashboard, mons not ready") return - if self.unit.is_leader() and not ceph_utils.is_dashboard_enabled(): - ceph_utils.mgr_enable_dashboard() + if not ceph_utils.is_dashboard_enabled(): + if self.unit.is_leader(): + ceph_utils.mgr_enable_dashboard() + else: + logging.info("Dashboard not enabled, deferring event.") + return + self._apply_ceph_config_from_charm_config() self._configure_tls() ceph_utils.mgr_config_set( diff --git a/tests/bundles/focal-yoga.yaml b/tests/bundles/focal-yoga.yaml index fb7448a..4fea677 100644 --- a/tests/bundles/focal-yoga.yaml +++ b/tests/bundles/focal-yoga.yaml @@ -7,7 +7,7 @@ applications: charm: ch:ceph-osd num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: source: *openstack-origin osd-devices: '/dev/test-non-existent' @@ -29,10 +29,10 @@ applications: num_units: 3 options: source: *openstack-origin - channel: latest/edge + channel: 8.0/edge vault-mysql-router: charm: ch:mysql-router - channel: latest/edge + channel: 8.0/edge ceph-dashboard: charm: ../../ceph-dashboard.charm options: @@ -62,20 +62,20 @@ applications: num_units: 3 options: source: *openstack-origin - channel: latest/edge + channel: quincy/edge ceph-fs: charm: ch:ceph-fs num_units: 1 options: source: *openstack-origin - channel: latest/edge + channel: quincy/edge ceph-iscsi: charm: ch:ceph-iscsi num_units: 2 options: source: *openstack-origin gateway-metadata-pool: iscsi-foo-metadata - channel: latest/edge + channel: quincy/edge relations: - - 'ceph-osd:mon' - 'ceph-mon:osd' diff --git a/tests/bundles/focal.yaml b/tests/bundles/focal.yaml index 3097ee7..3c3cde6 100644 --- a/tests/bundles/focal.yaml +++ b/tests/bundles/focal.yaml @@ -5,7 +5,7 @@ applications: charm: ch:ceph-osd num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: osd-devices: '/dev/test-non-existent' channel: latest/edge diff --git a/tests/bundles/jammy-antelope.yaml b/tests/bundles/jammy-antelope.yaml index 10d53b6..dfb6f2e 100644 --- a/tests/bundles/jammy-antelope.yaml +++ b/tests/bundles/jammy-antelope.yaml @@ -7,7 +7,7 @@ applications: charm: ch:ceph-osd num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: osd-devices: '/dev/test-non-existent' source: *openstack-origin @@ -27,10 +27,10 @@ applications: charm: ch:mysql-innodb-cluster constraints: mem=3072M num_units: 3 - channel: latest/edge + channel: 8.0/edge vault-mysql-router: charm: ch:mysql-router - channel: latest/edge + channel: 8.0/edge ceph-dashboard: charm: ../../ceph-dashboard.charm options: diff --git a/tests/bundles/jammy-yoga.yaml b/tests/bundles/jammy-yoga.yaml index 541cd41..dd81eb9 100644 --- a/tests/bundles/jammy-yoga.yaml +++ b/tests/bundles/jammy-yoga.yaml @@ -8,7 +8,7 @@ applications: charm: ch:ceph-osd num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: source: *openstack-origin osd-devices: '/dev/test-non-existent' diff --git a/tests/bundles/jammy-zed.yaml b/tests/bundles/jammy-zed.yaml index 694d84d..90ba720 100644 --- a/tests/bundles/jammy-zed.yaml +++ b/tests/bundles/jammy-zed.yaml @@ -7,7 +7,7 @@ applications: charm: ch:ceph-osd num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: osd-devices: '/dev/test-non-existent' source: *openstack-origin @@ -30,7 +30,7 @@ applications: channel: latest/edge vault-mysql-router: charm: ch:mysql-router - channel: latest/edge + channel: 8.0/edge ceph-dashboard: charm: ../../ceph-dashboard.charm options: diff --git a/tests/bundles/kinetic-zed.yaml b/tests/bundles/kinetic-zed.yaml index 300db74..a7df8a7 100644 --- a/tests/bundles/kinetic-zed.yaml +++ b/tests/bundles/kinetic-zed.yaml @@ -8,7 +8,7 @@ applications: series: kinetic num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: source: *source osd-devices: '/dev/test-non-existent' diff --git a/tests/bundles/lunar-antelope.yaml b/tests/bundles/lunar-antelope.yaml index 209d56e..e2a1ba2 100644 --- a/tests/bundles/lunar-antelope.yaml +++ b/tests/bundles/lunar-antelope.yaml @@ -8,11 +8,11 @@ applications: series: lunar num_units: 6 storage: - osd-devices: 'cinder,10G' + osd-devices: 'cinder,10G,2' options: source: *source osd-devices: '/dev/test-non-existent' - channel: latest/edge + channel: quincy/edge ceph-mon: charm: ch:ceph-mon series: lunar @@ -20,7 +20,7 @@ applications: options: source: *source monitor-count: '3' - channel: latest/edge + channel: quincy/edge vault: num_units: 1 charm: ch:vault @@ -31,10 +31,10 @@ applications: num_units: 3 options: source: *source - channel: latest/edge + channel: 8.0/edge vault-mysql-router: charm: ch:mysql-router - channel: latest/edge + channel: 8.0/edge ceph-dashboard: charm: ../../ceph-dashboard.charm options: @@ -63,14 +63,14 @@ applications: num_units: 3 options: source: *source - channel: latest/edge + channel: quincy/edge ceph-fs: charm: ch:ceph-fs series: lunar num_units: 1 options: source: *source - channel: latest/edge + channel: quincy/edge ceph-iscsi: charm: ch:ceph-iscsi series: lunar @@ -78,7 +78,7 @@ applications: options: source: *source gateway-metadata-pool: iscsi-foo-metadata - channel: latest/edge + channel: quincy/edge relations: - - 'ceph-osd:mon' - 'ceph-mon:osd'