4040- [x] Model structs for all Kubernetes objects
4141- [x] ` Codable ` support
4242- [x] ` Hashable ` resources
43+ - [x] ` Sendable ` support
4344- [x] Closure-based builders for convenient object composition
4445- [x] Type-erased wrappers for Kubernetes resources
4546- [x] ` UnstructuredResource ` type for handling any Kubernetes resource
4647
4748## Compatibility Matrix
4849
49- | | 1.25.9 | 1.26.4 | 1.28.0 | 1.28.3 | 1.29.6 | 1.32.0 |
50- | ----------| --------| --------| --------| --------| --------| --------|
51- | ` 0.9.x ` | ✓ | - | - | - | - | - |
52- | ` 0.10.x ` | - | ✓ | - | - | - | - |
53- | ` 0.11.x ` | - | ✓ | - | - | - | - |
54- | ` 0.12.x ` | - | - | ✓ | - | - | - |
55- | ` 0.13.x ` | - | - | - | ✓ | ✓ | - |
56- | ` 0.14.x ` | - | - | - | - | ✓ | - |
57- | ` 0.15.x ` | - | - | - | - | - | ✓ |
50+ | | 1.25.9 | 1.26.4 | 1.28.0 | 1.28.3 | 1.29.6 | 1.32.0 | 1.32.0 |
51+ | ----------| --------| --------| --------| --------| --------| --------| --------|
52+ | ` 0.9.x ` | ✓ | - | - | - | - | - | - |
53+ | ` 0.10.x ` | - | ✓ | - | - | - | - | - |
54+ | ` 0.11.x ` | - | ✓ | - | - | - | - | - |
55+ | ` 0.12.x ` | - | - | ✓ | - | - | - | - |
56+ | ` 0.13.x ` | - | - | - | ✓ | ✓ | - | - |
57+ | ` 0.14.x ` | - | - | - | - | ✓ | - | - |
58+ | ` 0.15.x ` | - | - | - | - | - | ✓ | ✓ |
59+ | ` 0.16.x ` | - | - | - | - | - | ✓ | ✓ |
5860
5961- ` ✓ ` Exact match of API objects in both model and the Kubernetes version.
6062- ` - ` API objects mismatches either due to the removal of old API or the addition of new API. However, everything the
@@ -183,6 +185,39 @@ let deployment = apps.v1.Deployment(
183185)
184186```
185187
188+ ### Sendables
189+
190+ All resources are ` Sendable ` structs.
191+
192+ There is, however, one caveat when working with resources having a ` JSONObject ` field:
193+
194+ - ` apiextensions.v1.CustomResourceValidation `
195+ - ` apps.v1.ControllerRevision `
196+ - ` meta.v1.ManagedFieldsEntry `
197+ - ` meta.v1.WatchEvent `
198+ - ` resource.v1alpha3.AllocatedDeviceStatus `
199+ - ` resource.v1alpha3.OpaqueDeviceConfiguration `
200+
201+ or when working with ` UnstructuredResource ` .
202+
203+ They store their properties as ` Dictionary<String, any Sendable> ` . Thus, dictionary literals must be
204+ explicitly cast to ` [String: any Sendable] ` .
205+
206+ For example:
207+
208+ ``` swift
209+ UnstructuredResource (properties : [
210+ " apiVersion" : " v1" ,
211+ " kind" : " ConfigMap" ,
212+ " metadata" : meta.v1 .ObjectMeta (name : " configs" , namespace : " default" ),
213+ " data" : [
214+ " foo" : 42 ,
215+ " bar" : " baz"
216+ ] as [String : any Sendable]
217+ ])
218+ ```
219+
220+
186221### Builders
187222
188223From the above example it is clear, that a certain knowledge of all the subtypes and their API groups is required, in
@@ -415,7 +450,7 @@ print(spec?["cronSpec"])
415450To use the ` SwiftkubeModel ` in a SwiftPM project, add the following line to the dependencies in your ` Package.swift ` file:
416451
417452``` swift
418- .package (name : " SwiftkubeModel" , url : " https://github.com/swiftkube/model.git" , from : " 0.14 .0" )
453+ .package (name : " SwiftkubeModel" , url : " https://github.com/swiftkube/model.git" , from : " 0.16 .0" )
419454```
420455
421456then include it as a dependency in your target:
@@ -426,7 +461,7 @@ import PackageDescription
426461let package = Package (
427462 // ...
428463 dependencies : [
429- .package (name : " SwiftkubeModel" , url : " https://github.com/swiftkube/model.git" , from : " 0.14 .0" )
464+ .package (name : " SwiftkubeModel" , url : " https://github.com/swiftkube/model.git" , from : " 0.16 .0" )
430465 ],
431466 targets : [
432467 .target (name : " <your-target>" , dependencies : [
0 commit comments