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

Merge 3.4 into 3.5 #64

Merged
merged 4 commits into from
Feb 10, 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
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the GPLv3, see LICENSE file for details.
name: juju-controller
assumes:
- juju >= 3.3
- juju >= 3.5
description: |
The Juju controller charm is used to expose various pieces
of functionality of a Juju controller.
Expand Down
5 changes: 3 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ops.framework import StoredState
from ops.charm import RelationJoinedEvent, RelationDepartedEvent
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus, ErrorStatus, Relation
from ops.model import ActiveStatus, BlockedStatus, Relation
from typing import List

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -84,7 +84,8 @@ def _on_metrics_endpoint_relation_created(self, event: RelationJoinedEvent):
try:
api_port = self.api_port()
except AgentConfException as e:
self.unit.status = ErrorStatus(f"can't read controller API port from agent.conf: {e}")
self.unit.status = BlockedStatus(
f"can't read controller API port from agent.conf: {e}")
return

metrics_endpoint = MetricsEndpointProvider(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import unittest
from charm import JujuControllerCharm, AgentConfException
from ops import ErrorStatus
from ops import BlockedStatus
from ops.testing import Harness
from unittest.mock import mock_open, patch

Expand Down Expand Up @@ -140,7 +140,7 @@ def test_apiaddresses_missing_status(self, *_):
harness.begin()

harness.add_relation('metrics-endpoint', 'prometheus-k8s')
self.assertEqual(harness.charm.unit.status, ErrorStatus(
self.assertEqual(harness.charm.unit.status, BlockedStatus(
"can't read controller API port from agent.conf: agent.conf key 'apiaddresses' missing"
))

Expand Down
Loading