Skip to content

Commit c4c2e85

Browse files
authored
Upgrade kernel to Kata 3.26.0. (apple#1134)
- Upgrade to containerization 0.24.5 to pick up zstd decompression enhancement. - Closes apple#767. - Closes apple#988. - Closes apple#1132. - Requires apple/containerization#508.
1 parent 5c86337 commit c4c2e85

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

‎Package.resolved‎

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

‎Package.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import PackageDescription
2323
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
2424
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
2525
let builderShimVersion = "0.7.0"
26-
let scVersion = "0.24.0"
26+
let scVersion = "0.24.5"
2727

2828
let package = Package(
2929
name: "container",

‎Sources/ContainerPersistence/DefaultsStore.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ extension DefaultsStore.Keys {
181181
}
182182
return "ghcr.io/apple/containerization/vminit:\(tag)"
183183
case .defaultKernelBinaryPath:
184-
return "opt/kata/share/kata-containers/vmlinux-6.12.42-162"
184+
return "opt/kata/share/kata-containers/vmlinux-6.18.5-177"
185185
case .defaultKernelURL:
186-
return "https://github.com/kata-containers/kata-containers/releases/download/3.20.0/kata-static-3.20.0-arm64.tar.xz"
186+
return "https://github.com/kata-containers/kata-containers/releases/download/3.26.0/kata-static-3.26.0-arm64.tar.zst"
187187
case .defaultSubnet:
188188
return "192.168.64.1/24"
189189
case .defaultIPv6Subnet:

‎Sources/ContainerResource/Common/ManagedResource.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public protocol ManagedResource: Identifiable, Sendable, Codable {
4444

4545
extension ManagedResource {
4646
/// Generate a random identifier that has the format of an ASCII SHA-256 hash.
47-
public static func randomId() -> String {
47+
public static func generateId() -> String {
4848
(0..<2)
4949
.map { _ in UInt128.random(in: 0...UInt128.max) }
5050
.map { String($0, radix: 16).padding(toLength: 32, withPad: "0", startingAt: 0) }

‎Tests/ContainerResourceTests/ManagedResourceTests.swift‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,14 @@ struct ManagedResourceTests {
2828
var creationDate: Date
2929
var labels: [String: String]
3030

31-
static func generateId() -> String {
32-
randomId()
33-
}
34-
3531
static func nameValid(_ name: String) -> Bool {
3632
true
3733
}
3834
}
3935

4036
@Test("randomId generates valid hex string SHA256 hash format")
4137
func testRandomIdFormat() {
42-
let id = MockManagedResource.randomId()
38+
let id = MockManagedResource.generateId()
4339

4440
// SHA256 hash is 64 hex characters (256 bits / 4 bits per hex char)
4541
#expect(id.count == 64, "randomId should generate 64 character string")
@@ -55,15 +51,15 @@ struct ManagedResourceTests {
5551
@Test("randomId generates unique values")
5652
func testRandomIdUniqueness() {
5753
// Generate multiple IDs and verify they're all different
58-
let ids = (0..<100).map { _ in MockManagedResource.randomId() }
54+
let ids = (0..<100).map { _ in MockManagedResource.generateId() }
5955
let uniqueIds = Set(ids)
6056

6157
#expect(uniqueIds.count == 100, "All generated IDs should be unique")
6258
}
6359

6460
@Test("randomId uses lowercase hexadecimal")
6561
func testRandomIdLowercase() {
66-
let id = MockManagedResource.randomId()
62+
let id = MockManagedResource.generateId()
6763

6864
// Should not contain uppercase letters
6965
let uppercaseLetters = CharacterSet.uppercaseLetters

0 commit comments

Comments
 (0)