File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments