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

Method uninstall

lib-engine/src/cmd/helm.rs:352–401  ·  view source on GitHub ↗
(
        &self,
        chart: &ChartInfo,
        envs: &[(&str, &str)],
        cmd_killer: &CommandKiller,
        stdout_output: &mut STDOUT,
        stderr_output: &mut STDERR,
    )

Source from the content-addressed store, hash-verified

350 }
351
352 pub fn uninstall<STDOUT, STDERR>(
353 &self,
354 chart: &ChartInfo,
355 envs: &[(&str, &str)],
356 cmd_killer: &CommandKiller,
357 stdout_output: &mut STDOUT,
358 stderr_output: &mut STDERR,
359 ) -> Result<(), HelmError>
360 where
361 STDOUT: FnMut(String),
362 STDERR: FnMut(String),
363 {
364 // If the release does not exist, we do not return an error
365 match self.check_release_exist(chart, envs) {
366 Ok(_) => {}
367 Err(ReleaseDoesNotExist(x)) => {
368 info!("Helm release `{x}` does not exist. Nothing to do");
369 return Ok(());
370 }
371 Err(err) => return Err(err),
372 }
373
374 let timeout = format!("{}s", &chart.timeout_in_seconds);
375 let namespace = chart.get_namespace_string();
376 let args = vec![
377 "uninstall",
378 &chart.name,
379 "--namespace",
380 &namespace,
381 "--timeout",
382 &timeout,
383 "--wait",
384 "--cascade=foreground",
385 "--ignore-not-found",
386 "--debug",
387 ];
388
389 let mut stderr = String::new();
390 let mut stderr_output = |line: String| {
391 stderr.push_str(&line);
392 stderr_output(line)
393 };
394 match helm_exec_with_output(&args, &self.get_all_envs(envs), stdout_output, &mut stderr_output, cmd_killer) {
395 Err(err) => {
396 stderr.push_str(&err.to_string());
397 Err(CmdError(chart.name.clone(), UNINSTALL, err.into()))
398 }
399 Ok(_) => Ok(()),
400 }
401 }
402
403 fn unlock_release(&self, chart: &ChartInfo, envs: &[(&str, &str)]) -> Result<(), HelmError> {
404 match self.check_release_exist(chart, envs) {

Callers 13

execMethod · 0.80
pre_execMethod · 0.80
execMethod · 0.80
delete_kube_appsFunction · 0.80
uninstall_chartFunction · 0.80
on_deleteMethod · 0.80
on_deleteMethod · 0.80
unlock_releaseMethod · 0.80
cleanupMethod · 0.80

Calls 5

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

Tested by 1

test_uninstallFunction · 0.64