Skip to content

Commit

Permalink
Fix for the dashboard relation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alesstimec committed Jul 3, 2023
1 parent 6deb07a commit 027864c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charms/jimm-k8s/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _update_workload(self, event):
if dashboard_relation and self.unit.is_leader():
dashboard_relation.data[self.app].update(
{
"controller-url": dns_name,
"controller-url": "wss://{}".format(dns_name),
"identity-provider-url": self.config.get("candid-url"),
"is-juju": str(False),
}
Expand Down Expand Up @@ -319,7 +319,7 @@ def _on_dashboard_relation_joined(self, event: RelationJoinedEvent):

event.relation.data[self.app].update(
{
"controller-url": dns_name,
"controller-url": "wss://{}".format(dns_name),
"identity-provider-url": self.config["candid-url"],
"is-juju": str(False),
}
Expand Down
2 changes: 1 addition & 1 deletion charms/jimm-k8s/tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_dashboard_relation_joined(self):
self.assertTrue(data)
self.assertEqual(
data["controller-url"],
"juju-jimm-k8s-0.juju-jimm-k8s-endpoints.None.svc.cluster.local",
"wss://juju-jimm-k8s-0.juju-jimm-k8s-endpoints.None.svc.cluster.local",
)
self.assertEqual(data["identity-provider-url"], "https://candid.example.com")
self.assertEqual(data["is-juju"], "False")
Expand Down
4 changes: 2 additions & 2 deletions charms/jimm/tests/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def test_dashboard_relation_joined(self):
harness.charm._agent_filename = tmp.name
harness.update_config(
{
"dns-name": "https://jimm.example.com",
"dns-name": "jimm.example.com",
"candid-agent-username": "username@candid",
"candid-agent-private-key": "agent-private-key",
"candid-agent-public-key": "agent-public-key",
Expand All @@ -526,7 +526,7 @@ def test_dashboard_relation_joined(self):
harness.add_relation_unit(id, "juju-dashboard/0")
data = harness.get_relation_data(id, "juju-jimm")
self.assertTrue(data)
self.assertEqual(data["controller-url"], "https://jimm.example.com")
self.assertEqual(data["controller-url"], "wss://jimm.example.com")
self.assertEqual(data["identity-provider-url"], "https://candid.example.com")
self.assertEqual(data["is-juju"], "False")

Expand Down

0 comments on commit 027864c

Please sign in to comment.