1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Typed Rust API for [Helm](https://helm.sh) 4.
//!
//! helm-rs drives Helm; it never reimplements Helm's engine. Everything Helm defines by a file
//! format or data (charts, values, schemas, release records, rendered manifests) is read natively
//! in Rust. Everything defined by Helm's behaviour (rendering, coalescing values, dependencies,
//! hooks, install, upgrade, wait) goes through a [`Backend`].
//!
//! The backend is a type parameter of [`Helm`], chosen statically; each backend sits behind its
//! own Cargo feature:
//!
//! - `cli` (default): [`cli::Cli`] runs the `helm` binary, Helm 4 only.
//! - `mock`: [`mock::Mock`], a scriptable backend for tests.
//! - `kube`: native reads that need a cluster connection ([`release::store`]).
//!
//! See [`cli::Cli`] for a `no_run` example against a real Helm and [`mock::Mock`] for a
//! runnable one.
//!
//! # Building commands
//!
//! Every command in [`command`] has a builder derived with [`bon`](https://bon-rs.com). The
//! arguments Helm requires go to `builder(...)`, so leaving one out does not compile; each flag
//! is a setter, with `maybe_<flag>` taking an `Option` and `&str` accepted wherever a `String` or
//! a path is stored. Repeated flags have a setter for the whole list and one for a single item.
//! `Command::new(...)` is the same command with every flag left to Helm.
//!
//! ```no_run
//! # async fn demo() -> helm_rs::Result<()> {
//! use std::time::Duration;
//!
//! use helm_rs::command::{ChartPathOptions, ChartRef, Install, ReleaseName, WaitStrategy};
//! use helm_rs::{Helm, Values};
//!
//! let helm = Helm::detect().await?.with_namespace("prod");
//! let install = Install::builder(
//! ReleaseName::Named("web".to_owned()),
//! ChartRef::Repo("charts/web".to_owned()),
//! )
//! .chart_path(ChartPathOptions::builder().version("^2.0.0").build())
//! .values(Values::new().set("replicas", 3))
//! .create_namespace(true)
//! .label("team", "web")
//! .wait(WaitStrategy::Watcher)
//! .timeout(Duration::from_secs(300))
//! .build();
//! let release = helm.run(install).await?;
//!
//! println!("{}", release.name);
//! # Ok(()) }
//! ```
//!
//! # Loading charts
//!
//! [`Chart::fetch`] loads a chart from wherever it lives: a path natively, a repository, URL or
//! `oci://` chart through `helm pull` into a temporary directory that is removed afterwards.
//!
//! ```no_run
//! # async fn demo() -> helm_rs::Result<()> {
//! use helm_rs::command::{ChartPathOptions, ChartRef};
//! use helm_rs::{Chart, Helm};
//!
//! let helm = Helm::detect().await?;
//! let options = ChartPathOptions::builder().version("1.2.3").build();
//! let chart = Chart::fetch(&helm, &ChartRef::Repo("charts/web".into()), &options).await?;
//!
//! println!("{}", chart.name());
//! # Ok(()) }
//! ```
pub use ;
pub use Chart;
pub use Cli;
pub use ;
pub use Helm;
pub use Manifest;
pub use ;
pub use Release;
pub use Values;