Use FilePath for ContainerResource.Bundle#26
Open
chrisgeo wants to merge 1 commit into
Open
Conversation
This was referenced May 9, 2026
c4d0073 to
bb488af
Compare
Closes CHAOS-1460. Unblocks CHAOS-1467 (server-side catch-all).
bb488af to
31b529a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContainerResource.BundlefromURLtoSystemPackage.FilePathacross 9 path references.Public API delta
Bundle.pathURLFilePathBundle.init(path:)URLFilePathBundle.bootlogURLFilePathBundle.containerRootfsBlockURLFilePathBundle.filePath(for:)-> URL-> FilePathBundle.create(path:…)URLFilePathBundle.containerLog(inContainerSandboxServiceClient)URLFilePathcontainerRootfsConfig(internal accessor) follows.Caller sites updated
Sources/Services/ContainerAPIService/Server/Containers/ContainersService.swift— 7 sites: lines 122, 791-794, 924-926, 962, 1065, 1109, 1168.Sources/Services/ContainerSandboxService/Server/SandboxService.swift— 6 sites: 156, 206, 248, 1236, 1451, 1465.Bundle+Log.swiftextension also migrated (containerLog: URL->FilePath).URL boundaries preserved (with reason)
All Foundation APIs that only accept
URLget a localized bridge with a one-line comment justifying the leak:Sources/ContainerResource/Container/Bundle.swift:53—Data(contentsOf:)forcontainerRootfsgetter.Sources/ContainerResource/Container/Bundle.swift:93,95—FileManager.copyItem(at:to:)andKernel.path(Containerization API stillURL).Sources/ContainerResource/Container/Bundle.swift:144—Data.write(to:)forsetContainerRootFs.Sources/ContainerResource/Container/Bundle.swift:170—Data.write(to:)(private staticwrite).Sources/ContainerResource/Container/Bundle.swift:178—Data(contentsOf:)(privateload).Sources/Services/ContainerAPIService/Server/Containers/ContainersService.swift:793-794—FileHandle(forReadingFrom:)for container log + bootlog.Sources/Services/ContainerSandboxService/Server/SandboxService.swift:206—FileHandle(forWritingTo:)for container log.Sources/Services/ContainerSandboxService/Server/SandboxService.swift:248—BootLog.file(path: URL, append: Bool)is a Containerization API stillURL.Sources/Services/ContainerSandboxService/Server/SandboxService.swift:1465—RuntimeConfiguration.pathis stillURL(out of scope, separate ticket).Sources/Services/ContainerSandboxService/Server/SandboxService.swift:156, 1451,ContainersService.swift:122, 791, 924, 962, 1065, 1109, 1168— call sites wherecontainerRoot/self.root/dirare stillURL(private fields, out of scope) bridged viaFilePath(url.path)at Bundle construction.Test plan
swift buildsucceeds with no warnings.swift test --filter ContainerResource— 36/36 pass.swift test --filter ContainerAPIService— 2/2 pass (RuntimeConfigurationTests).swift test --filter ContainerSandboxService— no dedicated unit tests target this module.lsp_diagnosticsclean on all 4 changed files.Closes CHAOS-1460. Part of CHAOS-1448 epic. Unblocks CHAOS-1467 (server-side catch-all).