mirror of
https://github.com/apple/container.git
synced 2026-09-23 16:15:37 +00:00
+2
-2
@@ -24,7 +24,7 @@ To file a bug or feature request, use [GitHub issues](https://github.com/apple/c
|
||||
|
||||
### Pull Requests
|
||||
|
||||
To make a pull request, use [GitHub](https://github.com/apple/containerization/compare). Please give the team a few days to review but it's ok to check in on occassion. We appreciate your contribution!
|
||||
To make a pull request, use [GitHub](https://github.com/apple/containerization/compare). Please give the team a few days to review but it's ok to check in on occasion. We appreciate your contribution!
|
||||
|
||||
> [!IMPORTANT]
|
||||
> If you plan to make substantial changes or add new features, we encourage you to first discuss them with the wider containerization developer community.
|
||||
@@ -45,7 +45,7 @@ Before merging, we'll review the pull request title and body to ensure it:
|
||||
|
||||
The pull request description should be concise and accurately describe the *what* and *why* of your changes.
|
||||
|
||||
#### Fomatting Contributions
|
||||
#### Formatting Contributions
|
||||
|
||||
Make sure your contributions are consistent with the rest of the project's formatting. You can do this using our Makefile:
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public struct Kernel: Sendable, Codable {
|
||||
|
||||
/// Additional kernel arguments.
|
||||
public var kernelArgs: [String]
|
||||
/// Additional arguments passsed to the Initial Process / Agent.
|
||||
/// Additional arguments passed to the Initial Process / Agent.
|
||||
public var initArgs: [String]
|
||||
|
||||
/// Initializes the kernel commandline using the mix of kernel arguments
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class LinuxContainer: Container, Sendable {
|
||||
case stopping(StoppingState)
|
||||
/// The container has ran and fully stopped.
|
||||
case stopped
|
||||
/// An error occured during the lifetime of this class.
|
||||
/// An error occurred during the lifetime of this class.
|
||||
case errored(Swift.Error)
|
||||
|
||||
struct CreatingState: Sendable {}
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class ArchiveWriter {
|
||||
try setOptions(configuration.options)
|
||||
}
|
||||
|
||||
/// Initialize a new `ArchiveWriter` with the given configuration and specifed delegate.
|
||||
/// Initialize a new `ArchiveWriter` with the given configuration and specified delegate.
|
||||
private convenience init(configuration: ArchiveWriterConfiguration, delegate: FileArchiveWriterDelegate) throws {
|
||||
try self.init(configuration: configuration)
|
||||
self.delegate = delegate
|
||||
|
||||
@@ -26,7 +26,7 @@ public final class ArchiveReader {
|
||||
let fileHandle: FileHandle?
|
||||
|
||||
/// Initializes an `ArchiveReader` to read from a specified file URL with an explicit `Format` and `Filter`.
|
||||
/// Note: This method must be used when it is known that the archive at the specified URL follows the specifed
|
||||
/// Note: This method must be used when it is known that the archive at the specified URL follows the specified
|
||||
/// `Format` and `Filter`.
|
||||
public convenience init(format: Format, filter: Filter, file: URL) throws {
|
||||
let fileHandle = try FileHandle(forReadingFrom: file)
|
||||
@@ -34,7 +34,7 @@ public final class ArchiveReader {
|
||||
}
|
||||
|
||||
/// Initializes an `ArchiveReader` to read from the provided file descriptor with an explicit `Format` and `Filter`.
|
||||
/// Note: This method must be used when it is known that the archive pointed to by the file descriptor follows the specifed
|
||||
/// Note: This method must be used when it is known that the archive pointed to by the file descriptor follows the specified
|
||||
/// `Format` and `Filter`.
|
||||
public init(format: Format, filter: Filter, fileHandle: FileHandle) throws {
|
||||
self.underlying = archive_read_new()
|
||||
|
||||
@@ -262,15 +262,15 @@ extension EXT4 {
|
||||
//
|
||||
// - Parameters:
|
||||
// - path: The FilePath representing the path where the file, directory, or symlink should be created.
|
||||
// - link: An optional FilePath representing the target path for a symlink. If `nil`, a regular file or directory will be created. Preceeding '/' should be ommitted
|
||||
// - link: An optional FilePath representing the target path for a symlink. If `nil`, a regular file or directory will be created. Preceding '/' should be omitted
|
||||
// - mode: The permissions to set for the created file, directory, or symlink.
|
||||
// - buf: An `InputStream` object providing the contents for the created file. Ignored when creating directories or symlinks.
|
||||
//
|
||||
// - Note:
|
||||
// - This function recursively creates parent directories if they don't already exist. The `uid` and `gid` of the created parent directories are set to the values of their parent's `uid` and `gid`.
|
||||
// - It is expected that the user sets the permissions explicity later
|
||||
// - It is expected that the user sets the permissions explicitly later
|
||||
// - This function only supports creating files, directories, and symlinks. Attempting to create other types of file system objects will result in an error.
|
||||
// - In case of symlinks, the preceeding '/' should be omitted
|
||||
// - In case of symlinks, the preceding '/' should be omitted
|
||||
//
|
||||
// - Example usage:
|
||||
// ```swift
|
||||
|
||||
@@ -186,8 +186,8 @@ extension EXT4 {
|
||||
try Self.write(buffer: &buffer, attrs: attributes, start: UInt16(idx), delta: UInt16(idx), inline: false)
|
||||
}
|
||||
|
||||
/// Writes the specified list of extended atrribute entries and their values to the provided
|
||||
/// This method does not fill in any headers (Inode inline / block level) that may be requried to parse these attributes
|
||||
/// Writes the specified list of extended attribute entries and their values to the provided
|
||||
/// This method does not fill in any headers (Inode inline / block level) that may be required to parse these attributes
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - buffer: An array of [UInt8] where the data will be written into
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// limitations under the License.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// AnnotationKeys contains a subset of "dictionary keys" for commonly used annotaions in an OCI Image Descriptor
|
||||
/// AnnotationKeys contains a subset of "dictionary keys" for commonly used annotations in an OCI Image Descriptor
|
||||
/// https://github.com/opencontainers/image-spec/blob/main/annotations.md
|
||||
public struct AnnotationKeys: Codable, Sendable {
|
||||
public static let containerizationImageName = "com.apple.containerization.image.name"
|
||||
|
||||
@@ -31,7 +31,7 @@ public protocol Content: Sendable {
|
||||
/// Size of content
|
||||
func size() throws -> UInt64
|
||||
|
||||
/// Data represenatation of entire content
|
||||
/// Data representation of entire content
|
||||
func data() throws -> Data
|
||||
|
||||
/// Data representation partial content
|
||||
|
||||
@@ -58,8 +58,8 @@ public final class AsyncSignalHandler: Sendable {
|
||||
}
|
||||
|
||||
// We keep a reference to the continuation object that is created for
|
||||
// our AsyncStream and tell our singal handler to yield a value to it
|
||||
// returing a value to the consumer
|
||||
// our AsyncStream and tell our signal handler to yield a value to it
|
||||
// returning a value to the consumer
|
||||
private func handler(_ sig: Int32) {
|
||||
self.state.withLock {
|
||||
for cont in $0.conts {
|
||||
|
||||
@@ -25,7 +25,7 @@ import Glibc
|
||||
private let _mount = Glibc.mount
|
||||
#endif
|
||||
|
||||
/// `Binfmt` is a utlity type that contains static helpers and types for
|
||||
/// `Binfmt` is a utility type that contains static helpers and types for
|
||||
/// mounting the Linux binfmt_misc filesystem, and creating new binfmt entries.
|
||||
public struct Binfmt: Sendable {
|
||||
/// Default mount path for binfmt_misc.
|
||||
|
||||
@@ -133,7 +133,7 @@ public final class Epoll: Sendable {
|
||||
self.handlers.del(fd)
|
||||
}
|
||||
|
||||
// The errno's here are accepable and can happen if the caller
|
||||
// The errno's here are acceptable and can happen if the caller
|
||||
// closed the underlying fd before calling delete().
|
||||
private func acceptableDeletionErrno() -> Bool {
|
||||
errno == ENOENT || errno == EBADF || errno == EPERM
|
||||
|
||||
@@ -40,26 +40,26 @@ struct OCITests {
|
||||
}
|
||||
|
||||
@Test func index() {
|
||||
var desciptors: [ContainerizationOCI.Descriptor] = []
|
||||
var descriptors: [ContainerizationOCI.Descriptor] = []
|
||||
for i in 0..<5 {
|
||||
let descriptor = ContainerizationOCI.Descriptor(mediaType: MediaTypes.descriptor, digest: "\(i)", size: Int64(i))
|
||||
desciptors.append(descriptor)
|
||||
descriptors.append(descriptor)
|
||||
}
|
||||
|
||||
let index = ContainerizationOCI.Index(schemaVersion: 1, manifests: desciptors)
|
||||
let index = ContainerizationOCI.Index(schemaVersion: 1, manifests: descriptors)
|
||||
#expect(index.manifests.count == 5)
|
||||
}
|
||||
|
||||
@Test func manifests() {
|
||||
var desciptors: [ContainerizationOCI.Descriptor] = []
|
||||
var descriptors: [ContainerizationOCI.Descriptor] = []
|
||||
for i in 0..<5 {
|
||||
let descriptor = ContainerizationOCI.Descriptor(mediaType: MediaTypes.descriptor, digest: "\(i)", size: Int64(i))
|
||||
desciptors.append(descriptor)
|
||||
descriptors.append(descriptor)
|
||||
}
|
||||
|
||||
let config = ContainerizationOCI.Descriptor(mediaType: MediaTypes.descriptor, digest: "123", size: 0)
|
||||
|
||||
let manifest = ContainerizationOCI.Manifest(schemaVersion: 1, config: config, layers: desciptors)
|
||||
let manifest = ContainerizationOCI.Manifest(schemaVersion: 1, config: config, layers: descriptors)
|
||||
#expect(manifest.config.digest == "123")
|
||||
#expect(manifest.layers.count == 5)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user