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
use super::shared::release_command;
use super::{ServerSide, ValuesMode};
use crate::backend::Command;
use crate::command::ChartRef;
use crate::release::Release;
release_command! {
/// `helm upgrade -o json` (`pkg/cmd/upgrade.go`, `pkg/action/upgrade.go`): upgrades a release to a
/// chart and returns the release Helm recorded. With `install`, a missing or uninstalled release
/// is installed instead and the same JSON comes back.
Upgrade, UpgradeBuilder, upgrade_builder {
required {
/// The `RELEASE` argument.
release: String,
}
collections {}
flags {
/// Flag `--cleanup-on-fail`: delete the resources this upgrade created if it fails.
cleanup_on_fail: bool,
/// 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 `--history-max`: how many revisions to keep; 0 keeps all (Helm's default is 10).
history_max: Option<u32>,
/// Flag `--install`: install when the release does not exist.
install: bool,
/// Flag `--render-subchart-notes`: include the subcharts' notes.
render_subchart_notes: bool,
/// Flags `--reset-values`, `--reuse-values` and `--reset-then-reuse-values`.
values_mode: Option<ValuesMode>,
/// Flag `--server-side` (Helm's default is `auto`).
server_side: Option<ServerSide>,
}
}
}
impl Upgrade {
/// An upgrade of `release` to `chart` with every other setting left to Helm.
#[must_use]
pub fn new(release: impl Into<String>, chart: ChartRef) -> Self {
Self::builder(release, chart).build()
}
}
impl Command for Upgrade {
type Output = Release;
}