Skip to content

Commit 69bea1c

Browse files
committed
Fix tests.
1 parent a846870 commit 69bea1c

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

eventsourcingdb/container.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,27 @@ def _create_container(self) -> None:
7878
encryption_algorithm=serialization.NoEncryption()
7979
)
8080

81-
# Create tar archive with the key file
81+
# Create tar archive with both the directory structure and the key file
8282
tar_stream = io.BytesIO()
8383
tar = tarfile.TarFile(fileobj=tar_stream, mode='w')
8484

85-
tarinfo = tarfile.TarInfo(name='signing-key.pem')
86-
tarinfo.size = len(signing_key_bytes)
87-
tarinfo.mode = 0o644
85+
# Add directory entry
86+
dir_info = tarfile.TarInfo(name='esdb')
87+
dir_info.type = tarfile.DIRTYPE
88+
dir_info.mode = 0o755
89+
tar.addfile(dir_info)
8890

89-
tar.addfile(tarinfo, io.BytesIO(signing_key_bytes))
90-
tar.close()
91+
# Add the key file
92+
file_info = tarfile.TarInfo(name='esdb/signing-key.pem')
93+
file_info.size = len(signing_key_bytes)
94+
file_info.mode = 0o644
95+
tar.addfile(file_info, io.BytesIO(signing_key_bytes))
9196

97+
tar.close()
9298
tar_stream.seek(0)
93-
self._container.put_archive('/etc/esdb', tar_stream)
99+
100+
# Put the archive into /etc which should exist
101+
self._container.put_archive('/etc', tar_stream)
94102

95103
def _extract_port_from_container_info(self, container_info) -> int | None:
96104
port = None

0 commit comments

Comments
 (0)