Skip to content

Commit

Permalink
Merge branch '6/edge' into DPE-5089-use-node-port
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Aug 23, 2024
2 parents 30becd8 + 797118e commit 1948e35
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 151 deletions.
21 changes: 21 additions & 0 deletions .github/.jira_sync_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Sync GitHub issues to Jira issues

# Configuration syntax:
# https://github.com/canonical/gh-jira-sync-bot/blob/main/README.md#client-side-configuration
settings:
# Repository specific settings
components: # Jira components that will be added to Jira issue
- mongodb-k8s

# Settings shared across Data Platform repositories
label_mapping:
# If the GitHub issue does not have a label in this mapping, the Jira issue will be created as a Bug
enhancement: Story
jira_project_key: DPE # https://warthogs.atlassian.net/browse/DPE
status_mapping:
opened: untriaged
closed: done # GitHub issue closed as completed
not_planned: rejected # GitHub issue closed as not planned
add_gh_comment: true
sync_description: false
sync_comments: false
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
channel: 6/edge
artifact-name: ${{ needs.build.outputs.artifact-name }}
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/sync_issue_to_jira.yaml

This file was deleted.

256 changes: 135 additions & 121 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ def remove_secret(self, scope, key) -> None:
content[key] = Config.Secrets.SECRET_DELETED_LABEL
secret.set_content(content)

@retry(
stop=stop_after_attempt(3),
wait=wait_fixed(2),
reraise=True,
)
def stop_mongos_service(self):
"""Stop mongos service."""
container = self.unit.get_container(Config.CONTAINER_NAME)
Expand All @@ -265,9 +260,8 @@ def restart_charm_services(self):
container = self.unit.get_container(Config.CONTAINER_NAME)
container.stop(Config.SERVICE_NAME)

for _ in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(2), reraise=True):
container.add_layer(Config.CONTAINER_NAME, self._mongos_layer, combine=True)
container.replan()
container.add_layer(Config.CONTAINER_NAME, self._mongos_layer, combine=True)
container.replan()

def set_database(self, database: str) -> None:
"""Updates the database requested for the mongos user."""
Expand Down
6 changes: 6 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class Substrate:
VM = "vm"
K8S = "k8s"

class Substrate:
"""Substrate related constants."""

VM = "vm"
K8S = "k8s"

class Role:
"""Role config names for MongoDB Charm."""

Expand Down
18 changes: 18 additions & 0 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ async def get_application_relation_data(
raise ValueError(f"no unit info could be grabbed for { unit.name}")
data = yaml.safe_load(raw_data)
# Filter the data based on the relation name.
<<<<<<< HEAD
relation_data = [v for v in data[unit.name]["relation-info"] if v["endpoint"] == relation_name]
=======
relation_data = [
v for v in data[unit.name]["relation-info"] if v["endpoint"] == relation_name
]
>>>>>>> 6/edge

if relation_id:
# Filter the data based on the relation id.
Expand All @@ -318,7 +324,13 @@ async def get_application_relation_data(
return relation_data[0]["application-data"].get(key)


<<<<<<< HEAD
async def get_mongos_user_password(ops_test: OpsTest, app_name=MONGOS_APP_NAME) -> Tuple[str, str]:
=======
async def get_mongos_user_password(
ops_test: OpsTest, app_name=MONGOS_APP_NAME
) -> Tuple[str, str]:
>>>>>>> 6/edge
secret_uri = await get_application_relation_data(
ops_test, app_name, relation_name="cluster", key="secret-user"
)
Expand All @@ -335,7 +347,13 @@ async def check_mongos(
uri: str = None,
) -> bool:
"""Returns True if mongos is running on the provided unit."""
<<<<<<< HEAD
mongos_client = await get_direct_mongos_client(ops_test, unit_id, auth, app_name, uri)
=======
mongos_client = await get_direct_mongos_client(
ops_test, unit_id, auth, app_name, uri
)
>>>>>>> 6/edge

try:
# wait 10 seconds in case the daemon was just started
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ async def test_waits_for_config_server(ops_test: OpsTest) -> None:
)


@pytest.mark.group(1)
@pytest.mark.abort_on_fail
async def test_mongos_starts_with_config_server(ops_test: OpsTest) -> None:
# prepare sharded cluster
await ops_test.model.wait_for_idle(
Expand Down

0 comments on commit 1948e35

Please sign in to comment.