Skip to content

Commit

Permalink
[MISC] Bump libs and remove TestCase (#622)
Browse files Browse the repository at this point in the history
* Bump libs

* Remove test case asserts

* Excessive assert
  • Loading branch information
dragomirp committed Sep 23, 2024
1 parent 36bac91 commit 7219d1e
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 384 deletions.
19 changes: 14 additions & 5 deletions lib/charms/tempo_k8s/v2/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, *args):
)
from ops.framework import EventSource, Object
from ops.model import ModelError, Relation
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, Field

# The unique Charmhub library identifier, never change it
LIBID = "12977e9aa0b34367903d8afeb8c3d85d"
Expand All @@ -107,7 +107,7 @@ def __init__(self, *args):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 8
LIBPATCH = 10

PYDEPS = ["pydantic"]

Expand Down Expand Up @@ -338,7 +338,7 @@ class Config:
class ProtocolType(BaseModel):
"""Protocol Type."""

model_config = ConfigDict(
model_config = ConfigDict( # type: ignore
# Allow serializing enum values.
use_enum_values=True
)
Expand Down Expand Up @@ -902,7 +902,16 @@ def _get_endpoint(
def get_endpoint(
self, protocol: ReceiverProtocol, relation: Optional[Relation] = None
) -> Optional[str]:
"""Receiver endpoint for the given protocol."""
"""Receiver endpoint for the given protocol.
It could happen that this function gets called before the provider publishes the endpoints.
In such a scenario, if a non-leader unit calls this function, a permission denied exception will be raised due to
restricted access. To prevent this, this function needs to be guarded by the `is_ready` check.
Raises:
ProtocolNotRequestedError:
If the charm unit is the leader unit and attempts to obtain an endpoint for a protocol it did not request.
"""
endpoint = self._get_endpoint(relation or self._relation, protocol=protocol)
if not endpoint:
requested_protocols = set()
Expand All @@ -925,7 +934,7 @@ def get_endpoint(
def charm_tracing_config(
endpoint_requirer: TracingEndpointRequirer, cert_path: Optional[Union[Path, str]]
) -> Tuple[Optional[str], Optional[str]]:
"""Utility function to determine the charm_tracing config you will likely want.
"""Return the charm_tracing config you likely want.
If no endpoint is provided:
disable charm tracing.
Expand Down
Loading

0 comments on commit 7219d1e

Please sign in to comment.