Skip to content

Commit

Permalink
Merge pull request #9 from canonical/juju-topology-model-fix
Browse files Browse the repository at this point in the history
added missing jujutopology fields, made the model private
  • Loading branch information
PietroPasotti authored Jul 3, 2024
2 parents d838cb3 + 982f2ff commit 17f1c98
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tempo_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ class DatabagAccessPermissionError(TempoClusterError):
"""Raised when a follower attempts to write leader settings."""


class JujuTopology(pydantic.BaseModel):
"""JujuTopology."""
class _JujuTopologyModel(pydantic.BaseModel):
"""_JujuTopologyModel."""

model: str
model_uuid: str
application: str
charm_name: str
unit: str
# ...


# DatabagModel implementation from traefik.v1.ingress charm lib.
Expand Down Expand Up @@ -224,7 +226,7 @@ class TempoClusterRequirerAppData(DatabagModel):
class TempoClusterRequirerUnitData(DatabagModel):
"""TempoClusterRequirerUnitData."""

juju_topology: JujuTopology
juju_topology: _JujuTopologyModel
address: str


Expand Down Expand Up @@ -262,7 +264,6 @@ def __init__(
):
super().__init__(charm, key or endpoint)
self._charm = charm
self.juju_topology = {"unit": self.model.unit.name, "model": self.model.name}

# filter out common unhappy relation states
self._relations: List[ops.Relation] = [
Expand Down

0 comments on commit 17f1c98

Please sign in to comment.