mirror of
https://github.com/apple/container.git
synced 2026-09-26 00:51:12 -04:00
Add backward compat for ContainerConfig cpuOverhead. (#1665)
1.0 data migration requirement
This commit is contained in:
@@ -160,6 +160,14 @@ public struct ContainerConfiguration: Sendable, Codable {
|
||||
public var cpuOverhead: Int = 1
|
||||
|
||||
public init() {}
|
||||
|
||||
public init(from decoder: any Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.cpus = try c.decodeIfPresent(Int.self, forKey: .cpus) ?? 4
|
||||
self.memoryInBytes = try c.decodeIfPresent(UInt64.self, forKey: .memoryInBytes) ?? 1024.mib()
|
||||
self.storage = try c.decodeIfPresent(UInt64.self, forKey: .storage)
|
||||
self.cpuOverhead = try c.decodeIfPresent(Int.self, forKey: .cpuOverhead) ?? 1
|
||||
}
|
||||
}
|
||||
|
||||
public init(
|
||||
|
||||
Reference in New Issue
Block a user