Skip to content

Commit 275d1da

Browse files
Merge branch 'main' into main
2 parents 0d91dcc + beb1592 commit 275d1da

34 files changed

Lines changed: 1846 additions & 405 deletions

NOTICE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ Unless required by applicable law or agreed to in writing, software distributed
4444
## Runtime Library Exception to the Apache 2.0 License: ##
4545
As an exception, if you use this Software to compile your source code and portions of this Software are embedded into the binary product as a result, you may redistribute such product without providing attribution as would otherwise be required by Sections 4(a), 4(b) and 4(d) of the License.
4646

47+
**Apple Inc. and the SwiftConfiguration project authors ( swift-configuration )**
48+
Copyright © 2025 Apple Inc. and the SwiftConfiguration project authors
49+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
50+
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
51+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
52+
4753
**Apple Inc. and the Swift Logging API project authors ( swift-log )**
4854
Copyright © 2018-2019 Apple Inc. and the Swift Logging API project authors
4955
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ let package = Package(
5050
.package(path: "~/projects/container/apple-container/containerization"),
5151
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
5252
.package(url: "https://github.com/apple/swift-collections.git", from: "1.2.0"),
53+
.package(url: "https://github.com/apple/swift-configuration", from: "1.0.0"),
5354
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
5455
.package(url: "https://github.com/apple/swift-nio.git", from: "2.80.0"),
5556
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.36.0"),
@@ -229,6 +230,7 @@ let package = Package(
229230
.product(name: "SystemPackage", package: "swift-system"),
230231
"ContainerAPIClient",
231232
"ContainerPersistence",
233+
"ContainerTestSupport",
232234
]
233235
),
234236
.executableTarget(
@@ -405,6 +407,7 @@ let package = Package(
405407
dependencies: [
406408
.product(name: "Logging", package: "swift-log"),
407409
.product(name: "Containerization", package: "containerization"),
410+
.product(name: "Configuration", package: "swift-configuration"),
408411
.product(name: "SystemPackage", package: "swift-system"),
409412
.product(name: "TOML", package: "swift-toml"),
410413
"CVersion",
@@ -414,6 +417,7 @@ let package = Package(
414417
.testTarget(
415418
name: "ContainerPersistenceTests",
416419
dependencies: [
420+
.product(name: "Configuration", package: "swift-configuration"),
417421
.product(name: "Logging", package: "swift-log"),
418422
.product(name: "SystemPackage", package: "swift-system"),
419423
"ContainerPersistence",

Sources/APIServer/APIServer+Start.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ extension APIServer {
5050
var logRoot = LogRoot.path
5151

5252
func run() async throws {
53-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
54-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
55-
)
53+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
5654
let commandName = APIServer._commandName
5755
let logPath = logRoot.map { $0.appending("\(commandName).log") }
5856
let log = ServiceLogger.bootstrap(category: "APIServer", debug: debug, logPath: logPath)

Sources/ContainerCommands/BuildCommand.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ extension Application {
149149
var pull: Bool = false
150150

151151
public func run() async throws {
152-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
153-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
154-
)
152+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
155153
do {
156154
let timeout: Duration = .seconds(300)
157155
let progressConfig = try ProgressConfig(

Sources/ContainerCommands/Builder/BuilderStart.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ extension Application {
5555
public init() {}
5656

5757
public func run() async throws {
58-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
59-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
60-
)
58+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
6159
let progressConfig = try ProgressConfig(
6260
showTasks: true,
6361
showItems: true,

Sources/ContainerCommands/Container/ContainerCreate.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ extension Application {
5656
var arguments: [String] = []
5757

5858
public func run() async throws {
59-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
60-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
61-
)
59+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
6260
let progressConfig = try ProgressConfig(
6361
showTasks: true,
6462
showItems: true,

Sources/ContainerCommands/Container/ContainerRun.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ extension Application {
6363
var arguments: [String] = []
6464

6565
public func run() async throws {
66-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
67-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
68-
)
66+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
6967
var exitCode: Int32 = 127
7068
let id = Utility.createContainerID(name: self.managementFlags.name)
7169

Sources/ContainerCommands/Image/ImageDelete.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ extension Application {
109109
}
110110

111111
public mutating func run() async throws {
112-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
113-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
114-
)
112+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
115113
try await DeleteImageImplementation.removeImage(options: options, containerSystemConfig: containerSystemConfig, log: log)
116114
}
117115
}

Sources/ContainerCommands/Image/ImageInspect.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ extension Application {
4545
}
4646

4747
public func run() async throws {
48-
let containerSystemConfig: ContainerSystemConfig = try SystemRuntimeOptions.loadConfig(
49-
configFile: SystemRuntimeOptions.configFileFromAppRoot(ApplicationRoot.url)
50-
)
48+
let containerSystemConfig: ContainerSystemConfig = try ConfigurationLoader.load()
5149
var printable: [ImageDetail] = []
5250
var succeededImages: [String] = []
5351
var allErrors: [(String, Error)] = []

0 commit comments

Comments
 (0)