From b0e9d0c95d644027436bf03912591e1979c18abb Mon Sep 17 00:00:00 2001 From: Jean-Gabriel Gill-Couture Date: Mon, 9 Jun 2025 14:40:00 -0400 Subject: [PATCH] chore: Remove unused imports and light formatting --- harmony/src/domain/topology/k8s.rs | 5 +++-- harmony/src/domain/topology/k8s_anywhere.rs | 8 ++++---- .../src/domain/topology/oberservability/monitoring.rs | 1 - harmony/src/domain/topology/tenant/k8s.rs | 9 +++------ harmony/src/modules/helm/command.rs | 4 ++-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/harmony/src/domain/topology/k8s.rs b/harmony/src/domain/topology/k8s.rs index c0b3b38..4a001c4 100644 --- a/harmony/src/domain/topology/k8s.rs +++ b/harmony/src/domain/topology/k8s.rs @@ -2,7 +2,7 @@ use derive_new::new; use k8s_openapi::{ClusterResourceScope, NamespaceResourceScope}; use kube::{ Api, Client, Config, Error, Resource, - api::{Patch, PatchParams, PostParams}, + api::{Patch, PatchParams}, config::{KubeConfigOptions, Kubeconfig}, }; use log::{debug, error, trace}; @@ -36,7 +36,8 @@ impl K8sClient { ); trace!("{:#?}", serde_json::to_string(resource)); - let api: Api = <::Scope as ApplyStrategy>::get_api(&self.client, namespace); + let api: Api = + <::Scope as ApplyStrategy>::get_api(&self.client, namespace); // api.create(&PostParams::default(), &resource).await let patch_params = PatchParams::apply("harmony"); let name = resource diff --git a/harmony/src/domain/topology/k8s_anywhere.rs b/harmony/src/domain/topology/k8s_anywhere.rs index fd0685d..f1d5a27 100644 --- a/harmony/src/domain/topology/k8s_anywhere.rs +++ b/harmony/src/domain/topology/k8s_anywhere.rs @@ -1,4 +1,4 @@ -use std::{io::Error, process::Command, sync::Arc}; +use std::{process::Command, sync::Arc}; use async_trait::async_trait; use inquire::Confirm; @@ -25,7 +25,7 @@ use super::{ struct K8sState { client: Arc, - source: K8sSource, + _source: K8sSource, message: String, } @@ -122,7 +122,7 @@ impl K8sAnywhereTopology { Some(client) => { return Ok(Some(K8sState { client: Arc::new(client), - source: K8sSource::Kubeconfig, + _source: K8sSource::Kubeconfig, message: format!("Loaded k8s client from kubeconfig {kubeconfig}"), })); } @@ -162,7 +162,7 @@ impl K8sAnywhereTopology { let state = match k3d.get_client().await { Ok(client) => K8sState { client: Arc::new(K8sClient::new(client)), - source: K8sSource::LocalK3d, + _source: K8sSource::LocalK3d, message: "Successfully installed K3D cluster and acquired client".to_string(), }, Err(_) => todo!(), diff --git a/harmony/src/domain/topology/oberservability/monitoring.rs b/harmony/src/domain/topology/oberservability/monitoring.rs index 4603eba..51ec38e 100644 --- a/harmony/src/domain/topology/oberservability/monitoring.rs +++ b/harmony/src/domain/topology/oberservability/monitoring.rs @@ -1,7 +1,6 @@ use async_trait::async_trait; use std::fmt::Debug; -use url::Url; use crate::interpret::InterpretError; diff --git a/harmony/src/domain/topology/tenant/k8s.rs b/harmony/src/domain/topology/tenant/k8s.rs index ed51d96..6bef378 100644 --- a/harmony/src/domain/topology/tenant/k8s.rs +++ b/harmony/src/domain/topology/tenant/k8s.rs @@ -3,12 +3,9 @@ use std::sync::Arc; use crate::{data::Id, executors::ExecutorError, topology::k8s::K8sClient}; use async_trait::async_trait; use derive_new::new; -use k8s_openapi::{ - NamespaceResourceScope, - api::{ - core::v1::{Namespace, ResourceQuota}, - networking::v1::NetworkPolicy, - }, +use k8s_openapi::api::{ + core::v1::{Namespace, ResourceQuota}, + networking::v1::NetworkPolicy, }; use kube::Resource; use serde::de::DeserializeOwned; diff --git a/harmony/src/modules/helm/command.rs b/harmony/src/modules/helm/command.rs index 41db685..14d2fc1 100644 --- a/harmony/src/modules/helm/command.rs +++ b/harmony/src/modules/helm/command.rs @@ -311,7 +311,7 @@ impl Interpret for HelmChartInterpretV _inventory: &Inventory, _topology: &T, ) -> Result { - let ns = self + let _ns = self .score .chart .namespace @@ -339,7 +339,7 @@ impl Interpret for HelmChartInterpretV let res = helm_executor.generate(); - let output = match res { + let _output = match res { Ok(output) => output, Err(err) => return Err(InterpretError::new(err.to_string())), };