Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hardcode relation in constants.py #285

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,16 +852,17 @@ def _handle_status_update_config(self, event: HookEvent) -> None:
event.defer()
return

if self.model.relations[KRATOS_INFO_RELATION_NAME] and self.public_ingress.relation is None:
if (
self.model.relations[KRATOS_INFO_RELATION_NAME]
and self.public_ingress.relation is None
):
self.unit.status = BlockedStatus(
"Cannot send integration data without an external hostname. Please "
"provide an ingress relation."
)
return
elif self.model.relations[KRATOS_INFO_RELATION_NAME] and self._public_url is None:
self.unit.status = WaitingStatus(
"Waiting for ingress"
)
self.unit.status = WaitingStatus("Waiting for ingress")
event.defer()
return

Expand Down
4 changes: 1 addition & 3 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from pathlib import Path

from charms.kratos.v0.kratos_info import RELATION_NAME

# Charm constants
WORKLOAD_CONTAINER_NAME = "kratos"
EMAIL_TEMPLATE_FILE_PATH = Path("/etc/config/templates") / "recovery-body.html.gotmpl"
Expand All @@ -33,7 +31,7 @@
DB_RELATION_NAME = "pg-database"
HYDRA_RELATION_NAME = "hydra-endpoint-info"
LOGIN_UI_RELATION_NAME = "ui-endpoint-info"
KRATOS_INFO_RELATION_NAME = RELATION_NAME
KRATOS_INFO_RELATION_NAME = "kratos-info"
PROMETHEUS_SCRAPE_RELATION_NAME = "metrics-endpoint"
LOKI_PUSH_API_RELATION_NAME = "logging"
GRAFANA_DASHBOARD_RELATION_NAME = "grafana-dashboard"
Expand Down