Skip to content

Commit 72530a3

Browse files
committed
Merge branch 'main' of https://github.com/DSS3113/container into custom-mac-address
2 parents a38bc9e + 4944fe1 commit 72530a3

File tree

24 files changed

+61
-61
lines changed

24 files changed

+61
-61
lines changed

Sources/ContainerClient/Core/ClientContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ extension ClientContainer {
277277
guard let fds else {
278278
throw ContainerizationError(
279279
.internalError,
280-
message: "No log fds returned"
280+
message: "no log fds returned"
281281
)
282282
}
283283
return fds

Sources/ContainerClient/Core/ClientImage.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct ClientImage: Sendable {
4141
/// Returns the underlying OCI index for the image.
4242
public func index() async throws -> Index {
4343
guard let content: Content = try await contentStore.get(digest: description.digest) else {
44-
throw ContainerizationError(.notFound, message: "Content with digest \(description.digest)")
44+
throw ContainerizationError(.notFound, message: "content with digest \(description.digest)")
4545
}
4646
return try content.decode()
4747
}
@@ -53,10 +53,10 @@ public struct ClientImage: Sendable {
5353
desc.platform == platform
5454
}
5555
guard let desc else {
56-
throw ContainerizationError(.unsupported, message: "Platform \(platform.description)")
56+
throw ContainerizationError(.unsupported, message: "platform \(platform.description)")
5757
}
5858
guard let content: Content = try await contentStore.get(digest: desc.digest) else {
59-
throw ContainerizationError(.notFound, message: "Content with digest \(desc.digest)")
59+
throw ContainerizationError(.notFound, message: "content with digest \(desc.digest)")
6060
}
6161
return try content.decode()
6262
}
@@ -66,7 +66,7 @@ public struct ClientImage: Sendable {
6666
let manifest = try await self.manifest(for: platform)
6767
let desc = manifest.config
6868
guard let content: Content = try await contentStore.get(digest: desc.digest) else {
69-
throw ContainerizationError(.notFound, message: "Content with digest \(desc.digest)")
69+
throw ContainerizationError(.notFound, message: "content with digest \(desc.digest)")
7070
}
7171
return try content.decode()
7272
}
@@ -83,7 +83,7 @@ public struct ClientImage: Sendable {
8383
guard let manifest = index.manifests.first else {
8484
throw ContainerizationError(
8585
.internalError,
86-
message: "Failed to resolve indirect index \(self.digest): no manifests found"
86+
message: "failed to resolve indirect index \(self.digest): no manifests found"
8787
)
8888
}
8989
return manifest
@@ -188,7 +188,7 @@ extension ClientImage {
188188
public static func get(reference: String) async throws -> ClientImage {
189189
let all = try await self.list()
190190
guard let found = try self._search(reference: reference, in: all) else {
191-
throw ContainerizationError(.notFound, message: "Image with reference \(reference)")
191+
throw ContainerizationError(.notFound, message: "image with reference \(reference)")
192192
}
193193
return found
194194
}
@@ -226,7 +226,7 @@ extension ClientImage {
226226

227227
let reference = try self.normalizeReference(reference)
228228
guard let host = try Reference.parse(reference).domain else {
229-
throw ContainerizationError(.invalidArgument, message: "Could not extract host from reference \(reference)")
229+
throw ContainerizationError(.invalidArgument, message: "could not extract host from reference \(reference)")
230230
}
231231

232232
request.set(key: .imageReference, value: reference)
@@ -320,7 +320,7 @@ extension ClientImage {
320320
let request = Self.newRequest(.imagePush)
321321

322322
guard let host = try Reference.parse(reference).domain else {
323-
throw ContainerizationError(.invalidArgument, message: "Could not extract host from reference \(reference)")
323+
throw ContainerizationError(.invalidArgument, message: "could not extract host from reference \(reference)")
324324
}
325325
request.set(key: .imageReference, value: reference)
326326

Sources/ContainerClient/Core/ClientKernel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extension ClientKernel {
7474
do {
7575
let reply = try await client.send(message)
7676
guard let kData = reply.dataNoCopy(key: .kernel) else {
77-
throw ContainerizationError(.internalError, message: "Missing kernel data from XPC response")
77+
throw ContainerizationError(.internalError, message: "missing kernel data from XPC response")
7878
}
7979

8080
let kernel = try JSONDecoder().decode(Kernel.self, from: kData)

Sources/ContainerClient/ExitMonitor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public actor ExitMonitor {
7676
throw ContainerizationError(.invalidState, message: "ExitMonitor not setup for process \(id)")
7777
}
7878
guard self.runningTasks[id] == nil else {
79-
throw ContainerizationError(.invalidState, message: "Already have a running task tracking process \(id)")
79+
throw ContainerizationError(.invalidState, message: "already have a running task tracking process \(id)")
8080
}
8181
self.runningTasks[id] = Task {
8282
do {

Sources/ContainerClient/Parser.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public struct Parser {
413413
case "volume":
414414
// For volume mounts, validate as volume name
415415
guard VolumeStorage.isValidVolumeName(val) else {
416-
throw ContainerizationError(.invalidArgument, message: "Invalid volume name '\(val)': must match \(VolumeStorage.volumeNamePattern)")
416+
throw ContainerizationError(.invalidArgument, message: "invalid volume name '\(val)': must match \(VolumeStorage.volumeNamePattern)")
417417
}
418418

419419
// This is a named volume
@@ -488,7 +488,7 @@ public struct Parser {
488488
guard src.hasPrefix("/") else {
489489
// Named volume - validate name syntax only
490490
guard VolumeStorage.isValidVolumeName(src) else {
491-
throw ContainerizationError(.invalidArgument, message: "Invalid volume name '\(src)': must match \(VolumeStorage.volumeNamePattern)")
491+
throw ContainerizationError(.invalidArgument, message: "invalid volume name '\(src)': must match \(VolumeStorage.volumeNamePattern)")
492492
}
493493

494494
// This is a named volume

Sources/ContainerClient/RequestScheme.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public enum RequestScheme: String, Sendable {
3333
case RequestScheme.auto.rawValue:
3434
self = .auto
3535
default:
36-
throw ContainerizationError(.invalidArgument, message: "Unsupported scheme \(rawValue)")
36+
throw ContainerizationError(.invalidArgument, message: "unsupported scheme \(rawValue)")
3737
}
3838
}
3939

@@ -42,7 +42,7 @@ public enum RequestScheme: String, Sendable {
4242
/// - Returns: RequestScheme
4343
package func schemeFor(host: String) throws -> Self {
4444
guard host.count > 0 else {
45-
throw ContainerizationError(.invalidArgument, message: "Host cannot be empty")
45+
throw ContainerizationError(.invalidArgument, message: "host cannot be empty")
4646
}
4747
switch self {
4848
case .http, .https:

Sources/ContainerClient/SandboxClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ extension XPCMessage {
281281
guard let id else {
282282
throw ContainerizationError(
283283
.invalidArgument,
284-
message: "No id"
284+
message: "no id"
285285
)
286286
}
287287
return id
@@ -292,7 +292,7 @@ extension XPCMessage {
292292
guard let data else {
293293
throw ContainerizationError(
294294
.invalidArgument,
295-
message: "No state data returned"
295+
message: "no state data returned"
296296
)
297297
}
298298
return try JSONDecoder().decode(SandboxSnapshot.self, from: data)

Sources/ContainerClient/Utility.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public struct Utility {
287287
let s: SystemPlatform = .current
288288
if let userKernel = management.kernel {
289289
guard FileManager.default.fileExists(atPath: userKernel) else {
290-
throw ContainerizationError(.notFound, message: "Kernel file not found at path \(userKernel)")
290+
throw ContainerizationError(.notFound, message: "kernel file not found at path \(userKernel)")
291291
}
292292
let p = URL(filePath: userKernel)
293293
return .init(path: p, platform: s)

Sources/ContainerCommands/Image/ImageInspect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension Application {
4848
print(try printable.jsonArray())
4949
}
5050
if notFound.count > 0 {
51-
throw ContainerizationError(.notFound, message: "Images: \(notFound.joined(separator: "\n"))")
51+
throw ContainerizationError(.notFound, message: "images: \(notFound.joined(separator: "\n"))")
5252
}
5353
}
5454
}

Sources/ContainerCommands/Image/ImageList.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ extension Application {
146146

147147
static func validate(options: ListImageOptions) throws {
148148
if options.quiet && options.verbose {
149-
throw ContainerizationError(.invalidArgument, message: "Cannot use flag --quite and --verbose together")
149+
throw ContainerizationError(.invalidArgument, message: "cannot use flag --quite and --verbose together")
150150
}
151151
let modifier = options.quiet || options.verbose
152152
if modifier && options.format == .json {
153-
throw ContainerizationError(.invalidArgument, message: "Cannot use flag --quite or --verbose along with --format json")
153+
throw ContainerizationError(.invalidArgument, message: "cannot use flag --quite or --verbose along with --format json")
154154
}
155155
}
156156

0 commit comments

Comments
 (0)