helm-rs 0.1.0

Typed Rust API for Helm 4: swappable backends, native chart, values and release reading
Documentation
use super::ReleaseName;
use super::shared::release_command;
use crate::backend::Command;
use crate::command::ChartRef;
use crate::release::Release;

release_command! {
    /// `helm install -o json` (`pkg/cmd/install.go`, `pkg/action/install.go`): installs a chart and
    /// returns the release Helm recorded (with `dry_run` set, the one it would record).
    Install, InstallBuilder, install_builder {
        required {
            /// The `NAME` argument, `--generate-name` or `--name-template`.
            name: ReleaseName,
        }
        collections {}
        flags {
            /// Flag `--hide-notes`: leave the notes out of the output.
            hide_notes: bool,
            /// Flag `--hide-secret`: hide Secrets in a dry-run (Helm requires a dry-run mode with it).
            hide_secret: bool,
            /// Flag `--render-subchart-notes`: include the subcharts' notes.
            render_subchart_notes: bool,
            /// Flag `--replace`: reuse the name of a deleted release that is still in the history.
            replace: bool,
            /// Flag `--server-side`, a boolean here that Helm defaults to true.
            server_side: Option<bool>,
        }
    }
}

impl Install {
    /// An install of `chart` under `name` with every other setting left to Helm.
    #[must_use]
    pub fn new(name: ReleaseName, chart: ChartRef) -> Self {
        Self::builder(name, chart).build()
    }
}

impl Command for Install {
    type Output = Release;
}