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

Method pre_exec

lib-engine/src/helm.rs:587–622  ·  view source on GitHub ↗
(
        &self,
        kube_client: &kube::Client,
        kubernetes_config: &Path,
        envs: &[(&str, &str)],
        payload: Option<ChartPayload>,
        _cmd_killer: &CommandKiller,
    )

Source from the content-addressed store, hash-verified

585 }
586
587 fn pre_exec(
588 &self,
589 kube_client: &kube::Client,
590 kubernetes_config: &Path,
591 envs: &[(&str, &str)],
592 payload: Option<ChartPayload>,
593 _cmd_killer: &CommandKiller,
594 ) -> Result<Option<ChartPayload>, HelmChartError> {
595 // Cleaning any existing crash looping pod for this helm chart
596 if let Some(selector) = self.get_selector() {
597 kubectl_delete_crash_looping_pods(
598 kubernetes_config,
599 Some(self.get_chart_info().get_namespace_string().as_str()),
600 Some(selector.as_str()),
601 envs.to_vec(),
602 )?;
603 }
604
605 // Force install CRDs if needed
606 let chart_info = &self.get_chart_info();
607 match chart_info.action {
608 Deploy => {
609 if let Some(crds_update) = &chart_info.crds_update
610 && let Err(_e) =
611 kubectl_update_crd(kube_client, chart_info.name.as_str(), crds_update.path.as_str())
612 {
613 return Err(HelmChartError::CannotUpdateCrds {
614 crd_path: crds_update.path.clone(),
615 });
616 }
617 }
618 HelmAction::Destroy => {}
619 }
620
621 Ok(payload)
622 }
623
624 fn run(
625 &self,

Callers

nothing calls this directly

Implementers 1

helm.rslib-engine/src/helm.rs

Calls 7

kubectl_update_crdFunction · 0.85
get_selectorMethod · 0.80
get_namespace_stringMethod · 0.80
as_strMethod · 0.45
get_chart_infoMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected