Skip to content

Commit

Permalink
[DPE-5915] Reduce pgdate permissions (#759)
Browse files Browse the repository at this point in the history
* Reduce pgdate permissions

* Disable indico tests
  • Loading branch information
dragomirp committed Nov 8, 2024
1 parent 8c186b8 commit b41e4f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def _create_pgdata(self, container: Container):
path = f"{self._storage_path}/pgdata"
if not container.exists(path):
container.make_dir(
path, permissions=0o770, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
path, permissions=0o750, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
)
# Also, fix the permissions from the parent directory.
container.exec([
Expand Down
1 change: 1 addition & 0 deletions tests/integration/new_relations/test_new_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ async def test_discourse(ops_test: OpsTest):


@pytest.mark.group(1)
@pytest.mark.unstable
@markers.amd64_only # indico charm not available for arm64
async def test_indico_datatabase(ops_test: OpsTest) -> None:
"""Tests deploying and relating to the Indico charm."""
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ def test_create_pgdata(harness):
container.exists.return_value = False
harness.charm._create_pgdata(container)
container.make_dir.assert_called_once_with(
"/var/lib/postgresql/data/pgdata", permissions=504, user="postgres", group="postgres"
"/var/lib/postgresql/data/pgdata", permissions=488, user="postgres", group="postgres"
)
container.exec.assert_called_once_with([
"chown",
Expand Down

0 comments on commit b41e4f2

Please sign in to comment.