Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
chore: update charm libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jul 3, 2023
1 parent 0832c37 commit caea33d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion lib/charms/data_platform_libs/v0/data_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent):

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

PYDEPS = ["ops>=2.0.0"]

Expand Down Expand Up @@ -1200,6 +1200,18 @@ def __init__(
self.topic = topic
self.consumer_group_prefix = consumer_group_prefix or ""

@property
def topic(self):
"""Topic to use in Kafka."""
return self._topic

@topic.setter
def topic(self, value):
# Avoid wildcards
if value == "*":
raise ValueError(f"Error on topic '{value}', cannot be a wildcard.")
self._topic = value

def _on_relation_joined_event(self, event: RelationJoinedEvent) -> None:
"""Event emitted when the application joins the Kafka relation."""
# Sets topic, extra user roles, and "consumer-group-prefix" in the relation
Expand Down
3 changes: 2 additions & 1 deletion lib/charms/prometheus_k8s/v0/prometheus_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def _on_scrape_targets_changed(self, event):

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

logger = logging.getLogger(__name__)

Expand All @@ -391,6 +391,7 @@ def _on_scrape_targets_changed(self, event):
"scheme",
"basic_auth",
"tls_config",
"authorization",
}
DEFAULT_JOB = {
"metrics_path": "/metrics",
Expand Down

0 comments on commit caea33d

Please sign in to comment.