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

Method rollback

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

Source from the content-addressed store, hash-verified

313 }
314
315 pub fn rollback(&self, chart: &ChartInfo, envs: &[(&str, &str)]) -> Result<(), HelmError> {
316 if self.check_release_exist(chart, envs)?.version <= 1 {
317 return Err(CannotRollback(chart.name.clone()));
318 }
319
320 let timeout = format!("{}s", &chart.timeout_in_seconds);
321 let namespace = chart.get_namespace_string();
322 let args = vec![
323 "rollback",
324 &chart.name,
325 "--namespace",
326 &namespace,
327 "--timeout",
328 &timeout,
329 "--history-max",
330 HELM_MAX_HISTORY,
331 "--cleanup-on-fail",
332 "--force",
333 "--wait",
334 ];
335
336 let mut stderr = String::new();
337 match helm_exec_with_output(
338 &args,
339 &self.get_all_envs(envs),
340 &mut |_| {},
341 &mut |line| stderr.push_str(&line),
342 &CommandKiller::never(),
343 ) {
344 Err(err) => {
345 stderr.push_str(err.to_string().as_str());
346 Err(CmdError(chart.name.clone(), ROLLBACK, err.into()))
347 }
348 Ok(_) => Ok(()),
349 }
350 }
351
352 pub fn uninstall<STDOUT, STDERR>(
353 &self,

Callers 2

unlock_releaseMethod · 0.80
test_rollbackFunction · 0.80

Calls 6

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

Tested by 1

test_rollbackFunction · 0.64