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
1414full = [" k8s" , " flux-converter" ]
1515k8s = [
1616 " stackable-versioned-macros/k8s" , # Forward the k8s feature to the underlying macro crate
17+ " dep:kube" ,
18+ " dep:k8s-openapi" ,
1719]
1820flux-converter = [
1921 " 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::*;
1818#[ cfg( feature = "flux-converter" ) ]
1919mod flux_converter;
2020
21+ #[ cfg( feature = "k8s" ) ]
22+ mod apply_resource;
23+
2124#[ cfg( feature = "flux-converter" ) ]
2225pub use flux_converter:: ConversionError ;
2326
You can’t perform that action at this time.
0 commit comments