@@ -109,17 +109,16 @@ func TestPowerMonitorTolerations(t *testing.T) {
109
109
110
110
func TestPowerMonitorDaemonSet (t * testing.T ) {
111
111
tt := []struct {
112
- spec v1alpha1.PowerMonitorInternalKeplerSpec
113
- hostPID bool
114
- exporterCommand []string
115
- volumeMounts []corev1.VolumeMount
116
- volumes []corev1.Volume
117
- containers []string
118
- scenario string
119
- addConfigMap bool
120
- configMap * corev1.ConfigMap
121
- annotation map [string ]string
122
- expectedLivenessProbeURL string
112
+ spec v1alpha1.PowerMonitorInternalKeplerSpec
113
+ hostPID bool
114
+ exporterCommand []string
115
+ volumeMounts []corev1.VolumeMount
116
+ volumes []corev1.Volume
117
+ containers []string
118
+ scenario string
119
+ addConfigMap bool
120
+ configMap * corev1.ConfigMap
121
+ annotation map [string ]string
123
122
}{
124
123
{
125
124
spec : v1alpha1.PowerMonitorInternalKeplerSpec {},
@@ -141,9 +140,8 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
141
140
k8s .VolumeFromHost ("procfs" , "/proc" ),
142
141
k8s .VolumeFromConfigMap ("cfm" , "power-monitor-internal" ),
143
142
},
144
- containers : []string {"power-monitor-internal" },
145
- scenario : "default case" ,
146
- expectedLivenessProbeURL : fmt .Sprintf ("http://0.0.0.0:%d/metrics" , PowerMonitorDSPort ),
143
+ containers : []string {"power-monitor-internal" },
144
+ scenario : "default case" ,
147
145
},
148
146
{
149
147
spec : v1alpha1.PowerMonitorInternalKeplerSpec {},
@@ -178,8 +176,7 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
178
176
annotation : map [string ]string {
179
177
ConfigMapHashAnnotation + "-power-monitor-internal" : "123" ,
180
178
},
181
- scenario : "configmap case" ,
182
- expectedLivenessProbeURL : fmt .Sprintf ("http://0.0.0.0:%d/metrics" , PowerMonitorDSPort ),
179
+ scenario : "configmap case" ,
183
180
},
184
181
{
185
182
spec : v1alpha1.PowerMonitorInternalKeplerSpec {
@@ -211,9 +208,8 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
211
208
k8s .VolumeFromSecret (SecretTLSCertName , SecretTLSCertName ),
212
209
k8s .VolumeFromSecret (SecretKubeRBACProxyConfigName , SecretKubeRBACProxyConfigName ),
213
210
},
214
- containers : []string {"power-monitor-internal" , KubeRBACProxyContainerName },
215
- scenario : "rbac case" ,
216
- expectedLivenessProbeURL : fmt .Sprintf ("http://127.0.0.1:%d/metrics" , PowerMonitorDSPort ),
211
+ containers : []string {"power-monitor-internal" , KubeRBACProxyContainerName },
212
+ scenario : "rbac case" ,
217
213
},
218
214
}
219
215
for _ , tc := range tt {
@@ -252,14 +248,6 @@ func TestPowerMonitorDaemonSet(t *testing.T) {
252
248
actualAnnotation := k8s .AnnotationFromDS (ds )
253
249
assert .Contains (t , actualAnnotation , ConfigMapHashAnnotation + "-power-monitor-internal" )
254
250
}
255
-
256
- // Validate liveness probe configuration
257
- container := ds .Spec .Template .Spec .Containers [0 ]
258
- assert .NotNil (t , container .LivenessProbe , "liveness probe should be configured" )
259
-
260
- expectedCommand := []string {"curl" , "-f" , "-s" , tc .expectedLivenessProbeURL }
261
- assert .Equal (t , expectedCommand , container .LivenessProbe .Exec .Command ,
262
- "liveness probe exec command should use curl with correct URL" )
263
251
})
264
252
}
265
253
}
0 commit comments