Skip to content

Commit

Permalink
Change pgdata permissions to 0o700 + fix charm bases in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shayancanonical committed Sep 23, 2024
1 parent 6cc2b74 commit 52271e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,10 @@ 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=0o700, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
)
else:
container.exec(["chmod", "700", path]).wait()
# Also, fix the permissions from the parent directory.
container.exec([
"chown",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ async def test_extensions_blocking(ops_test: OpsTest) -> None:
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=APPLICATION_NAME,
series=CHARM_BASE,
base=CHARM_BASE,
channel="edge",
)
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=f"{APPLICATION_NAME}2",
series=CHARM_BASE,
base=CHARM_BASE,
channel="edge",
)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_db_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def test_discourse_from_discourse_charmers(ops_test: OpsTest):
await asyncio.gather(
build_and_deploy(ops_test, DATABASE_UNITS),
ops_test.model.deploy(
REDIS_APP_NAME, application_name=REDIS_APP_NAME, base=CHARM_BASE
REDIS_APP_NAME, application_name=REDIS_APP_NAME, base="[email protected]"
),
)
await ops_test.model.wait_for_idle(
Expand Down

0 comments on commit 52271e1

Please sign in to comment.