(
&self,
kube_client: &kube::Client,
kubernetes_config: &Path,
envs: &[(&str, &str)],
payload: Option<ChartPayload>,
_cmd_killer: &CommandKiller,
)
| 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, |
nothing calls this directly
no test coverage detected