diff --git a/charms/horizon-k8s/lib/charms/horizon_k8s/v0/trusted_dashboard.py b/charms/horizon-k8s/lib/charms/horizon_k8s/v0/trusted_dashboard.py index c574ff62..49670bbd 100644 --- a/charms/horizon-k8s/lib/charms/horizon_k8s/v0/trusted_dashboard.py +++ b/charms/horizon-k8s/lib/charms/horizon_k8s/v0/trusted_dashboard.py @@ -308,7 +308,6 @@ class TrustedDashboardRequirer(Object): """Handle relation broken event.""" logger.info("Relation broken, clearing federated providers.") - event.relation.data[event.app].clear() self.on.dashboard_changed.emit(trusted_dashboard="") def get_trusted_dashboard(self, relation_id: Optional[int] = None) -> Optional[str]: diff --git a/charms/horizon-k8s/src/charm.py b/charms/horizon-k8s/src/charm.py index 2efd7066..e39af4c7 100755 --- a/charms/horizon-k8s/src/charm.py +++ b/charms/horizon-k8s/src/charm.py @@ -214,14 +214,8 @@ class HorizonOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm): if not self.model.unit.is_leader(): return - fid_providers = event.fid_providers - if not fid_providers: - logger.debug("No FID providers found, skipping update.") - return - - logger.debug( - "Setting trusted dashboard provider info: %s", fid_providers - ) + # Set the trusted dashboard URL regardless of whether or not the + # requirer sets FID providers. self.trusted_dashboard.set_provider_info( trusted_dashboard=self._websso_url ) @@ -299,6 +293,9 @@ class HorizonOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm): """Configure charm services.""" super().configure_charm(event) if self.bootstrapped(): + # Handle the case where TLS is enabled/external hostname is changed + # and we need to update the trusted dashboard URL in keystone. + self._on_trusted_dashboard_providers_changed(event) self.status.set(ops.model.ActiveStatus("")) if self.model.unit.is_leader(): if self.ingress_public.url: diff --git a/charms/keystone-k8s/src/charm.py b/charms/keystone-k8s/src/charm.py index 5c3421cc..4d690ea4 100755 --- a/charms/keystone-k8s/src/charm.py +++ b/charms/keystone-k8s/src/charm.py @@ -673,8 +673,7 @@ class TrustedDashboardRequiresHandler(sunbeam_rhandlers.RelationHandler): ) def _on_trusted_dashboard(self, event): - if self.interface.get_trusted_dashboard(): - self.callback_f(event) + self.callback_f(event) def context(self): """Configuration context."""