Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Sources/Containerization/LinuxContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,9 @@ extension LinuxContainer {
config.interfaces
}

/// Create the underlying container's virtual machine
/// and set up the runtime environment.
/// Create and start the underlying container's virtual machine
/// and set up the runtime environment. The container's init process
/// is NOT running afterwards.
public func create() async throws {
try self.state.withLock { try $0.setCreating() }

Expand Down Expand Up @@ -538,7 +539,7 @@ extension LinuxContainer {
}
}

/// Start the container container's initial process.
/// Start the container's initial process.
public func start() async throws {
let vm = try self.state.withLock { try $0.setStarting() }

Expand Down Expand Up @@ -569,6 +570,7 @@ extension LinuxContainer {
try self.state.withLock { try $0.setStarted(process: process) }
} catch {
try? await agent.close()
try? await vm.stop()
self.state.withLock { $0.errored(error: error) }
throw error
}
Expand Down