mirror of
https://github.com/apple/container.git
synced 2026-07-14 05:27:02 +00:00
Deps: Bump Containerization to 0.24.0 (#1127)
Brings in some rlimit bumps/adjustments
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"originHash" : "d365630cbc06f2576b1aeeb963f7d7029cda9c57fc39d4df121349db2517d332",
|
||||
"originHash" : "b5e7886cffebc763ebcce883e1b62740a6d38a8166d53a28fe1635148c5e4c12",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "async-http-client",
|
||||
@@ -15,8 +15,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/containerization.git",
|
||||
"state" : {
|
||||
"revision" : "3a0b79d7fb982fa6518d95e3a172dbfee5d8e634",
|
||||
"version" : "0.23.2"
|
||||
"revision" : "92b02fc497953d2d59d29af425d29a1d8a783f1c",
|
||||
"version" : "0.24.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import PackageDescription
|
||||
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
|
||||
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
|
||||
let builderShimVersion = "0.7.0"
|
||||
let scVersion = "0.23.2"
|
||||
let scVersion = "0.24.0"
|
||||
|
||||
let package = Package(
|
||||
name: "container",
|
||||
|
||||
@@ -681,8 +681,11 @@ public actor SandboxService {
|
||||
}
|
||||
|
||||
let containerInfo = try self.getContainer()
|
||||
|
||||
let czConfig = self.configureProcessConfig(config: processInfo.config, stdio: processInfo.io, containerConfig: containerInfo.config)
|
||||
let czConfig = try self.configureProcessConfig(
|
||||
config: processInfo.config,
|
||||
stdio: processInfo.io,
|
||||
containerConfig: containerInfo.config
|
||||
)
|
||||
|
||||
let process = try await container.exec(id, configuration: czConfig)
|
||||
try self.setUnderlyingProcess(id, process)
|
||||
@@ -861,7 +864,7 @@ public actor SandboxService {
|
||||
searchDomains: dns.searchDomains, options: dns.options)
|
||||
}
|
||||
|
||||
Self.configureInitialProcess(czConfig: &czConfig, config: config)
|
||||
try Self.configureInitialProcess(czConfig: &czConfig, config: config)
|
||||
}
|
||||
|
||||
private func getDefaultNameservers(attachmentConfigurations: [AttachmentConfiguration]) async throws -> [String] {
|
||||
@@ -880,7 +883,7 @@ public actor SandboxService {
|
||||
private static func configureInitialProcess(
|
||||
czConfig: inout LinuxContainer.Configuration,
|
||||
config: ContainerConfiguration
|
||||
) {
|
||||
) throws {
|
||||
let process = config.initProcess
|
||||
|
||||
czConfig.process.arguments = [process.executable] + process.arguments
|
||||
@@ -894,8 +897,12 @@ public actor SandboxService {
|
||||
|
||||
czConfig.process.terminal = process.terminal
|
||||
czConfig.process.workingDirectory = process.workingDirectory
|
||||
czConfig.process.rlimits = process.rlimits.map {
|
||||
.init(type: $0.limit, hard: $0.hard, soft: $0.soft)
|
||||
try czConfig.process.rlimits = process.rlimits.map {
|
||||
LinuxRLimit(
|
||||
kind: try LinuxRLimit.Kind($0.limit),
|
||||
hard: $0.hard,
|
||||
soft: $0.soft
|
||||
)
|
||||
}
|
||||
switch process.user {
|
||||
case .raw(let name):
|
||||
@@ -918,7 +925,7 @@ public actor SandboxService {
|
||||
}
|
||||
|
||||
private nonisolated func configureProcessConfig(config: ProcessConfiguration, stdio: [FileHandle?], containerConfig: ContainerConfiguration)
|
||||
-> LinuxProcessConfiguration
|
||||
throws -> LinuxProcessConfiguration
|
||||
{
|
||||
var proc = LinuxProcessConfiguration()
|
||||
proc.stdin = stdio[0]
|
||||
@@ -936,8 +943,12 @@ public actor SandboxService {
|
||||
|
||||
proc.terminal = config.terminal
|
||||
proc.workingDirectory = config.workingDirectory
|
||||
proc.rlimits = config.rlimits.map {
|
||||
.init(type: $0.limit, hard: $0.hard, soft: $0.soft)
|
||||
try proc.rlimits = config.rlimits.map {
|
||||
LinuxRLimit(
|
||||
kind: try LinuxRLimit.Kind($0.limit),
|
||||
hard: $0.hard,
|
||||
soft: $0.soft
|
||||
)
|
||||
}
|
||||
switch config.user {
|
||||
case .raw(let name):
|
||||
|
||||
Reference in New Issue
Block a user