use std::path::PathBuf;
use crate::backend::Command;
use crate::command::release::{ReleaseName, release_command};
use crate::manifest::Rendered;
release_command! {
Template, TemplateBuilder, template_builder {
required {}
collections {
api_versions / api_version: String, "--api-versions",
"Kubernetes API versions for `Capabilities.APIVersions`";
show_only / add_show_only: String, "--show-only",
"print only the documents of these templates (globs such as `templates/*.yaml` \
work); a template without output is an error";
}
flags {
name: Option<ReleaseName>,
include_crds: bool,
is_upgrade: bool,
kube_version: Option<String>,
output_dir: Option<PathBuf>,
replace: bool,
server_side: Option<bool>,
skip_tests: bool,
use_release_name: bool,
}
}
}
impl Template {
#[must_use]
pub fn new(chart: crate::command::ChartRef) -> Self {
Self::builder(chart).build()
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Templated {
Rendered(Rendered),
Written(Vec<PathBuf>),
}
impl Command for Template {
type Output = Templated;
}