Skip to content

Commit e72ef54

Browse files
authored
style: remove unused fields from health checkers (#957)
1 parent 752e428 commit e72ef54

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

agent-control/src/sub_agent/health/k8s/health_checker.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl SubAgentHealthChecker<K8sHealthChecker> {
7878
health_checkers.push(K8sHealthChecker::Flux(K8sHealthFluxHelmRelease::new(
7979
k8s_client.clone(),
8080
name.clone(),
81-
resource.clone(),
8281
start_time,
8382
)));
8483

@@ -105,7 +104,6 @@ impl SubAgentHealthChecker<K8sHealthChecker> {
105104
K8sHealthNRInstrumentation::new(
106105
k8s_client.clone(),
107106
name.clone(),
108-
resource.clone(),
109107
start_time,
110108
),
111109
));

agent-control/src/sub_agent/health/k8s/helm_release.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::sub_agent::health::health_checker::{
66
};
77
use crate::sub_agent::health::with_start_time::{HealthWithStartTime, StartTime};
88
use k8s_openapi::serde_json::{Map, Value};
9-
use kube::api::DynamicObject;
109
use std::sync::Arc;
1110

1211
const CONDITION_READY: &str = "Ready";
@@ -37,21 +36,14 @@ impl From<&str> for ConditionStatus {
3736
pub struct K8sHealthFluxHelmRelease {
3837
k8s_client: Arc<SyncK8sClient>,
3938
name: String,
40-
k8s_object: DynamicObject,
4139
start_time: StartTime,
4240
}
4341

4442
impl K8sHealthFluxHelmRelease {
45-
pub fn new(
46-
k8s_client: Arc<SyncK8sClient>,
47-
name: String,
48-
k8s_object: DynamicObject,
49-
start_time: StartTime,
50-
) -> Self {
43+
pub fn new(k8s_client: Arc<SyncK8sClient>, name: String, start_time: StartTime) -> Self {
5144
Self {
5245
k8s_client,
5346
name,
54-
k8s_object,
5547
start_time,
5648
}
5749
}
@@ -266,7 +258,6 @@ pub mod tests {
266258
let checker = K8sHealthFluxHelmRelease::new(
267259
Arc::new(mock_client),
268260
"example-release".to_string(),
269-
dynamic_object(),
270261
start_time,
271262
);
272263
let result = checker.check_health();
@@ -287,14 +278,6 @@ pub mod tests {
287278
}
288279
}
289280

290-
fn dynamic_object() -> DynamicObject {
291-
DynamicObject {
292-
types: Some(helm_release_type_meta()),
293-
metadata: ObjectMeta::default(),
294-
data: json!({}),
295-
}
296-
}
297-
298281
fn setup_mock_client_with_conditions(
299282
mock: &mut MockSyncK8sClient,
300283
status_conditions: serde_json::Value,

agent-control/src/sub_agent/health/k8s/instrumentation.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::sub_agent::health::health_checker::{
55
Health, HealthChecker, HealthCheckerError, Healthy, Unhealthy,
66
};
77
use crate::sub_agent::health::with_start_time::{HealthWithStartTime, StartTime};
8-
use kube::api::DynamicObject;
98
use serde::Deserialize;
109
use std::fmt::Display;
1110
use std::sync::Arc;
@@ -109,21 +108,14 @@ impl Display for UnhealthyPodError {
109108
pub struct K8sHealthNRInstrumentation {
110109
k8s_client: Arc<SyncK8sClient>,
111110
name: String,
112-
k8s_object: DynamicObject,
113111
start_time: StartTime,
114112
}
115113

116114
impl K8sHealthNRInstrumentation {
117-
pub fn new(
118-
k8s_client: Arc<SyncK8sClient>,
119-
name: String,
120-
k8s_object: DynamicObject,
121-
start_time: StartTime,
122-
) -> Self {
115+
pub fn new(k8s_client: Arc<SyncK8sClient>, name: String, start_time: StartTime) -> Self {
123116
Self {
124117
k8s_client,
125118
name,
126-
k8s_object,
127119
start_time,
128120
}
129121
}

0 commit comments

Comments
 (0)