diff options
Diffstat (limited to 'src/context.rs')
-rw-r--r-- | src/context.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/context.rs b/src/context.rs new file mode 100644 index 0000000..c8be716 --- /dev/null +++ b/src/context.rs @@ -0,0 +1,18 @@ +use kube::Client; + +/// Context injected with each `reconcile` and `on_error` method invocation. +pub struct ContextData { + /// Kubernetes client to make Kubernetes API requests with. + pub client: Client, +} + +impl ContextData { + /// Constructs a new instance of ContextData. + /// + /// # Arguments: + /// - `client`: A Kubernetes client to make Kubernetes REST API requests with. Resources + /// will be created and deleted with this client. + pub fn new(client: Client) -> Self { + ContextData { client } + } +} |