Skip to content

Commit dbec1db

Browse files
Add support for aarch64 architecture alias (#1040)
- Adds `aarch64` as an alias for `arm64` in the `Arch` enum. This addresses the maintainer's request to support this common architecture name, ensuring consistency with `x86_64` normalization and preventing failures for users expecting `aarch64` support.
1 parent 837aa5e commit dbec1db

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/Services/ContainerAPIService/Client/Arch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum Arch: String {
1919

2020
public init?(rawValue: String) {
2121
switch rawValue.lowercased() {
22-
case "arm64":
22+
case "arm64", "aarch64":
2323
self = .arm64
2424
case "amd64", "x86_64", "x86-64":
2525
self = .amd64

Tests/ContainerAPIClientTests/ArchTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@ struct ArchTests {
4444
#expect(arch == .arm64)
4545
}
4646

47+
@Test func testAarch64Alias() throws {
48+
let arch = Arch(rawValue: "aarch64")
49+
#expect(arch != nil)
50+
#expect(arch == .arm64)
51+
}
52+
4753
@Test func testCaseInsensitive() throws {
4854
#expect(Arch(rawValue: "AMD64") == .amd64)
4955
#expect(Arch(rawValue: "X86_64") == .amd64)
5056
#expect(Arch(rawValue: "ARM64") == .arm64)
57+
#expect(Arch(rawValue: "AARCH64") == .arm64)
5158
#expect(Arch(rawValue: "Amd64") == .amd64)
5259
}
5360

0 commit comments

Comments
 (0)