Files
container/Sources/ContainerResource/Container/ContainerStopOptions.swift
T
Danny Canter de780c1478 cli: Add support for --stop-signal (#1462)
- Closes #1581.
- This adds stop signal support to the cli. The priority is:
  1. If an explicit stop signal is passed on the cli use this.
  2. If not, check if there is a stop signal in the image config.
  3. Finally, use the default (TERM).
2026-05-21 17:55:48 -07:00

33 lines
1.2 KiB
Swift

//===----------------------------------------------------------------------===//
// Copyright © 2026 Apple Inc. and the container project authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//===----------------------------------------------------------------------===//
import Foundation
public struct ContainerStopOptions: Sendable, Codable {
public var timeoutInSeconds: Int32
public var signal: String?
public static let `default` = ContainerStopOptions(
timeoutInSeconds: 5,
signal: nil
)
public init(timeoutInSeconds: Int32, signal: String?) {
self.timeoutInSeconds = timeoutInSeconds
self.signal = signal
}
}