helm-rs 0.1.1

Typed Rust API for Helm 4: swappable backends, native chart, values and release reading
Documentation
use std::collections::BTreeMap;
use std::fs;
use std::path::PathBuf;
use std::time::Duration;

use serde_json::json;

use crate::cli::testing::{FlagRow, argv, check_flags, invocation};
use crate::cli::{CliCommand, Invocation};
use crate::command::{
    Cascade, ChartPathOptions, ChartRef, DryRun, Force, GetAll, GetHooks, GetManifest, GetMetadata,
    GetNotes, GetValues, History, Install, List, ReleaseName, Rollback, ServerSide, Status, Test,
    Uninstall, Upgrade, ValuesMode, WaitStrategy,
};
use crate::error::Error;
use crate::release::{ApplyMethod, Revision, Status as State};
use crate::values::Values;

pub(super) fn fixture(name: &str) -> String {
    let path = format!(
        "{}/tests/fixtures/commands/release/{name}",
        env!("CARGO_MANIFEST_DIR")
    );

    fs::read_to_string(path).expect("fixture")
}

pub(super) fn install() -> Install {
    Install::new(
        ReleaseName::Named("web".into()),
        ChartRef::Repo("repo/web".into()),
    )
}

pub(super) fn upgrade() -> Upgrade {
    Upgrade::new("web", ChartRef::Repo("repo/web".into()))
}

pub(super) fn labels(pairs: &[(&str, &str)]) -> BTreeMap<String, String> {
    pairs
        .iter()
        .map(|(k, v)| ((*k).to_owned(), (*v).to_owned()))
        .collect()
}

mod chart;
pub(in crate::cli) mod install;
mod lifecycle;
mod output;