File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
crates/stackable-versioned Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ all-features = true
14
14
full = [" k8s" , " flux-converter" ]
15
15
k8s = [
16
16
" stackable-versioned-macros/k8s" , # Forward the k8s feature to the underlying macro crate
17
+ " dep:kube" ,
18
+ " dep:k8s-openapi" ,
17
19
]
18
20
flux-converter = [
19
21
" k8s" ,
Original file line number Diff line number Diff line change
1
+ use k8s_openapi:: Resource ;
2
+ use kube:: Client ;
3
+ use serde:: Serialize ;
4
+
5
+ /// Given a [kube::Client], apply a resource to the server.
6
+ ///
7
+ /// This is esspecially useful when you have custom requirements for deploying
8
+ /// CRDs to clusters which already have a definition.
9
+ ///
10
+ /// For example, you want to prevent stable versions (v1) from having any
11
+ /// change.
12
+ pub trait ApplyResource : Resource + Serialize {
13
+ type Error ;
14
+
15
+ /// Apply a resource to a cluster
16
+ fn apply ( & self , kube_client : Client ) -> Result < ( ) , Self :: Error > ;
17
+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ pub use stackable_versioned_macros::*;
18
18
#[ cfg( feature = "flux-converter" ) ]
19
19
mod flux_converter;
20
20
21
+ #[ cfg( feature = "k8s" ) ]
22
+ mod apply_resource;
23
+
21
24
#[ cfg( feature = "flux-converter" ) ]
22
25
pub use flux_converter:: ConversionError ;
23
26
You can’t perform that action at this time.
0 commit comments