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

Method drop

lib-engine/src/cmd/helm.rs:2050–2090  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2048
2049impl Drop for HelmRegistry<'_> {
2050 fn drop(&mut self) {
2051 if !self.login {
2052 return;
2053 }
2054
2055 let (registry_config_path, repository_config_path, repository_cache_path) =
2056 Helm::get_helm_cmd_paths(self.repository_cache_path);
2057 let helm_logout_args = vec![
2058 "registry",
2059 "--debug", // there is no debug log but if someday they appear
2060 "logout",
2061 self.registry_url,
2062 "--registry-config",
2063 &registry_config_path,
2064 "--repository-config",
2065 &repository_config_path,
2066 "--repository-cache",
2067 &repository_cache_path,
2068 ];
2069
2070 let mut error_message: Vec<String> = Vec::new();
2071 let helm_ret = helm_exec_with_output(
2072 helm_logout_args.as_slice(),
2073 self.envs,
2074 &mut |line| {
2075 info!("{}", line);
2076 },
2077 &mut |line| {
2078 warn!("repository {}: {}", self.registry_url, self.username);
2079 // we don't want to flood user with debug log
2080 if line.contains(" [debug] ") {
2081 return;
2082 }
2083 error_message.push(line);
2084 },
2085 self.cmd_killer,
2086 );
2087 if let Err(err) = helm_ret {
2088 error!("Helm logout error: {:?}", err);
2089 };
2090 }
2091}
2092
2093#[cfg(feature = "test-local-kube")]

Callers

nothing calls this directly

Calls 3

helm_exec_with_outputFunction · 0.85
pushMethod · 0.80
cleanupMethod · 0.45

Tested by

no test coverage detected