9
9
<a href="https://swiftpackageindex.com/swiftkube/client">
10
10
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswiftkube%2Fclient%2Fbadge%3Ftype%3Dplatforms"/>
11
11
</a>
12
- <a href="https://v1-28.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.28 /">
13
- <img src="https://img.shields.io/badge/Kubernetes-1.29.6 -blue.svg" alt="Kubernetes 1.29.6 "/>
12
+ <a href="https://v1-28.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.32 /">
13
+ <img src="https://img.shields.io/badge/Kubernetes-1.32.0 -blue.svg" alt="Kubernetes 1.32.0 "/>
14
14
</a>
15
15
<a href="https://swift.org/package-manager">
16
16
<img src="https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat" alt="Swift Package Manager" />
42
42
Swift client for talking to a [ Kubernetes] ( http://kubernetes.io/ ) cluster via a fluent DSL based
43
43
on [ SwiftNIO] ( https://github.com/apple/swift-nio ) and the [ AysncHTTPClient] ( https://github.com/swift-server/async-http-client ) .
44
44
45
- - [x] Covers all Kubernetes API Groups in v1.28.3
45
+ - [x] Covers all Kubernetes API Groups in v1.32.0
46
46
- [x] Automatic configuration discovery
47
47
- [x] DSL style API
48
48
- [x] For all API Groups/Versions
@@ -68,18 +68,14 @@ on [SwiftNIO](https://github.com/apple/swift-nio) and the [AysncHTTPClient](http
68
68
69
69
## Compatibility Matrix
70
70
71
- | | 1.18.9 | 1.19.8 | 1.20.9 | 1.22.7 | 1.24.8 | 1.24.10 | 1.26.4 | 1.28.0 | 1.28.3 | 1.29.6 |
72
- | -------------------| --------| --------| --------| --------| --------| ---------| --------| --------| --------| --------|
73
- | ` 0.6.x ` | ✓ | - | - | - | - | - | - | - | - | - |
74
- | ` 0.7.x...0.9.x ` | - | ✓ | - | - | - | - | - | - | - | - |
75
- | ` 0.10.x ` | - | - | ✓ | - | - | - | - | - | - | - |
76
- | ` 0.11.x ` | - | - | - | ✓ | - | - | - | - | - | - |
77
- | ` 0.12.x...0.13.x ` | - | - | - | - | ✓ | - | - | - | - | - |
78
- | ` 0.14.x ` | - | - | - | - | - | ✓ | - | - | - | - |
79
- | ` 0.15.x ` | - | - | - | - | - | - | ✓ | - | - | - |
80
- | ` 0.16.x ` | - | - | - | - | - | - | - | ✓ | - | - |
81
- | ` 0.17.x ` | - | - | - | - | - | - | - | - | ✓ | - |
82
- | ` 0.18.x ` | - | - | - | - | - | - | - | - | - | ✓ |
71
+ | | 1.24.10 | 1.26.4 | 1.28.0 | 1.28.3 | 1.29.6 | 1.32.0 |
72
+ | -------------------| ---------| --------| --------| --------| --------| --------|
73
+ | ` 0.14.x ` | ✓ | - | - | - | - | - |
74
+ | ` 0.15.x ` | - | ✓ | - | - | - | - |
75
+ | ` 0.16.x ` | - | - | ✓ | - | - | - |
76
+ | ` 0.17.x ` | - | - | - | ✓ | - | - |
77
+ | ` 0.18.x ` | - | - | - | - | ✓ | - |
78
+ | ` 0.19.x ` | - | - | - | - | - | ✓ |
83
79
84
80
- ` ✓ ` Exact match of API objects in both client and the Kubernetes version.
85
81
- ` - ` API objects mismatches either due to the removal of old API or the addition of new API. However, everything the
@@ -264,7 +260,7 @@ buffering policy is used, which should be taken into consideration.
264
260
265
261
``` swift
266
262
let task: SwiftkubeClientTask = client.pods .watch (in : .allNamespaces )
267
- let stream = task.start ()
263
+ let stream = await task.start ()
268
264
269
265
for try await event in stream {
270
266
print (event)
@@ -299,7 +295,7 @@ let strategy = RetryStrategy(
299
295
)
300
296
let task = client.pods .watch (in : .default , retryStrategy : strategy)
301
297
302
- for try await event in task.stream () {
298
+ for try await event in await task.stream () {
303
299
print (event)
304
300
}
305
301
```
@@ -405,7 +401,7 @@ try await client.apiExtensionsV1.customResourceDefinitions.create(crd)
405
401
The ` KubernetesClient ` can now be "extended", in order to manage the Custom Resources. One way would be to use the
406
402
` UnstructuredResource ` described in the previous section given some ` GroupVersionResource ` .
407
403
408
- However, the client can work with any object that implement the relevant marker protocols, which allows for custom types
404
+ However, the client can work with any object that implements the relevant marker protocols, which allows for custom types
409
405
to be defined and used directly.
410
406
411
407
Here is a complete example to clarify.
@@ -456,7 +452,7 @@ The marker protocols are:
456
452
- ` CollectionDeletableResource` activate the `deleteAll` API for the resource
457
453
- ` ScalableResource` activates the `scale` API for the resource
458
454
- ` MetadataHavingResource` indicates, that the resource has a `metadata` field of type `meta.v1.ObjectMeta?`
459
- - ` StatusHavingResource` indicate, that the resource has a `scale ` field (w/o assuming its type)
455
+ - ` StatusHavingResource` indicate, that the resource has a `state ` field (w/o assuming its type)
460
456
461
457
The following custom structs can be defined :
462
458
@@ -470,7 +466,7 @@ struct CronTab: KubernetesAPIResource, NamespacedResource, MetadataHavingResourc
470
466
var spec: CronTabSpec
471
467
}
472
468
473
- struct CronTabSpec: Codable, Hashable {
469
+ struct CronTabSpec: Codable, Hashable, Sendable {
474
470
var cronSpec: String
475
471
var image: String
476
472
var replicas: Int
@@ -548,7 +544,7 @@ app.get("metrics") { request -> EventLoopFuture<String> in
548
544
To use the `SwiftkubeClient` in a SwiftPM project, add the following line to the dependencies in your `Package.swift` file :
549
545
550
546
` ` ` swift
551
- .package(name: "SwiftkubeClient", url: "https://github.com/swiftkube/client.git", from: "0.18 .0")
547
+ .package(name: "SwiftkubeClient", url: "https://github.com/swiftkube/client.git", from: "0.19 .0")
552
548
` ` `
553
549
554
550
then include it as a dependency in your target :
@@ -559,7 +555,7 @@ import PackageDescription
559
555
let package = Package(
560
556
// ...
561
557
dependencies: [
562
- .package(name: "SwiftkubeClient", url: "https://github.com/swiftkube/client.git", from: "0.18 .0")
558
+ .package(name: "SwiftkubeClient", url: "https://github.com/swiftkube/client.git", from: "0.19 .0")
563
559
],
564
560
targets: [
565
561
.target(name: "<your-target>", dependencies: [
0 commit comments