MCPcopy Create free account
hub / github.com/Qovery/engine / check_release_exist

Method check_release_exist

lib-engine/src/cmd/helm.rs:289–313  ·  view source on GitHub ↗
(&self, chart: &ChartInfo, envs: &[(&str, &str)])

Source from the content-addressed store, hash-verified

287 }
288
289 pub fn check_release_exist(&self, chart: &ChartInfo, envs: &[(&str, &str)]) -> Result<ReleaseStatus, HelmError> {
290 let namespace = chart.get_namespace_string();
291 let args = vec!["status", &chart.name, "--namespace", &namespace, "-o", "json"];
292
293 let mut stdout = String::new();
294 let mut stderr = String::new();
295 match helm_exec_with_output(
296 &args,
297 &self.get_all_envs(envs),
298 &mut |line| stdout.push_str(&line),
299 &mut |line| stderr.push_str(&line),
300 &CommandKiller::never(),
301 ) {
302 Err(_) if stderr.contains("release: not found") => Err(ReleaseDoesNotExist(chart.name.clone())),
303 Err(_) if stderr.contains("Release name is invalid") => Err(ReleaseNameInvalid(chart.name.clone())),
304 Err(err) => {
305 stderr.push_str(err.to_string().as_str());
306 Err(CmdError(chart.name.clone(), STATUS, err.into()))
307 }
308 Ok(_) => {
309 let status: ReleaseStatus = serde_json::from_str(&stdout).unwrap_or_default();
310 Ok(status)
311 }
312 }
313 }
314
315 pub fn rollback(&self, chart: &ChartInfo, envs: &[(&str, &str)]) -> Result<(), HelmError> {
316 if self.check_release_exist(chart, envs)?.version <= 1 {

Callers 9

rollbackMethod · 0.80
uninstallMethod · 0.80
unlock_releaseMethod · 0.80
test_release_existFunction · 0.80
test_upgradeFunction · 0.80
test_upgrade_timeoutFunction · 0.80
test_uninstallFunction · 0.80

Calls 5

helm_exec_with_outputFunction · 0.85
get_namespace_stringMethod · 0.80
get_all_envsMethod · 0.45
cloneMethod · 0.45
as_strMethod · 0.45

Tested by 6

test_release_existFunction · 0.64
test_upgradeFunction · 0.64
test_upgrade_timeoutFunction · 0.64
test_uninstallFunction · 0.64