@@ -232,7 +232,6 @@ public actor ContainersService {
232232 }
233233
234234 let path = self . containerRoot. appendingPathComponent ( configuration. id)
235- let metadataPath = self . getMetadataPath ( for: configuration. id, containerRoot: self . containerRoot)
236235 let systemPlatform = kernel. platform
237236 let initFs = try await self . getInitBlock ( for: systemPlatform. ociPlatform ( ) )
238237
@@ -249,7 +248,7 @@ public actor ContainersService {
249248 options: options
250249 )
251250
252- try ContainerResource . Bundle. writeMetadata ( completeMetadata, to : metadataPath )
251+ try ContainerResource . Bundle. writeMetadata ( completeMetadata)
253252
254253 let snapshot = ContainerSnapshot (
255254 configuration: configuration,
@@ -279,7 +278,7 @@ public actor ContainersService {
279278 }
280279
281280 let path = self . containerRoot. appendingPathComponent ( id)
282- let config = try await self . getContainerConfiguration ( for : id , at: path)
281+ let config = try await self . getContainerConfiguration ( at: path)
283282
284283 do {
285284 try Self . registerService (
@@ -705,18 +704,11 @@ public actor ContainersService {
705704 }
706705 }
707706
708- /// Get metadata file path for the given container ID
709- private nonisolated func getMetadataPath( for containerID: String , containerRoot: URL ) -> URL {
710- containerRoot. appendingPathComponent ( containerID)
711- . appendingPathComponent ( " bundle-metadata.json " )
712- }
713-
714707 /// Get container configuration, either from existing bundle or from metadata
715- private func getContainerConfiguration( for id : String , at path: URL ) async throws -> ContainerConfiguration {
708+ private func getContainerConfiguration( at path: URL ) async throws -> ContainerConfiguration {
716709 guard await bundleExists ( at: path) else {
717710 // Bundle doesn't exist, get config from metadata
718- let metadataPath = self . getMetadataPath ( for: id, containerRoot: self . containerRoot)
719- let metadata = try ContainerResource . Bundle. readMetadata ( from: metadataPath)
711+ let metadata = try ContainerResource . Bundle. readMetadata ( from: path)
720712 guard let config = metadata. containerConfiguration else {
721713 throw ContainerizationError ( . internalError, message: " Metadata missing container configuration " )
722714 }
0 commit comments