4
4
package e2e
5
5
6
6
import (
7
+ "strconv"
7
8
"testing"
8
9
"time"
9
10
@@ -22,7 +23,7 @@ func TestPowerMonitor_Deletion(t *testing.T) {
22
23
f := test .NewFramework (t )
23
24
24
25
// pre-condition: ensure powermonitor exists
25
- f .CreatePowerMonitor ("power-monitor" , f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
26
+ f .CreatePowerMonitor ("power-monitor" , f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
26
27
pm := f .WaitUntilPowerMonitorCondition ("power-monitor" , v1alpha1 .Available , v1alpha1 .ConditionTrue )
27
28
28
29
//
@@ -48,7 +49,7 @@ func TestPowerMonitor_Reconciliation(t *testing.T) {
48
49
f .AssertNoResourceExists ("power-monitor" , "" , & v1alpha1.PowerMonitor {})
49
50
50
51
// when
51
- pm := f .CreatePowerMonitor ("power-monitor" , f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
52
+ pm := f .CreatePowerMonitor ("power-monitor" , f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
52
53
53
54
// then
54
55
f .AssertResourceExists (controller .PowerMonitorDeploymentNS , "" , & corev1.Namespace {})
@@ -95,7 +96,7 @@ func TestPowerMonitorNodeSelector(t *testing.T) {
95
96
96
97
pm := f .CreatePowerMonitor ("power-monitor" ,
97
98
f .WithPowerMonitorNodeSelector (labels ),
98
- f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
99
+ f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
99
100
100
101
f .AssertResourceExists (controller .PowerMonitorDeploymentNS , "" , & corev1.Namespace {})
101
102
ds := appsv1.DaemonSet {}
@@ -119,7 +120,7 @@ func TestPowerMonitorNodeSelectorUnavailableLabel(t *testing.T) {
119
120
120
121
pm := f .CreatePowerMonitor ("power-monitor" ,
121
122
f .WithPowerMonitorNodeSelector (unavailableLabels ),
122
- f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
123
+ f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
123
124
124
125
f .AssertResourceExists (controller .PowerMonitorDeploymentNS , "" , & corev1.Namespace {})
125
126
ds := appsv1.DaemonSet {}
@@ -155,7 +156,7 @@ func TestPowerMonitorTaint_WithToleration(t *testing.T) {
155
156
156
157
pm := f .CreatePowerMonitor ("power-monitor" ,
157
158
f .WithPowerMonitorTolerations (append (node .Spec .Taints , e2eTestTaint )),
158
- f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
159
+ f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
159
160
f .AssertResourceExists (controller .PowerMonitorDeploymentNS , "" , & corev1.Namespace {})
160
161
ds := appsv1.DaemonSet {}
161
162
f .AssertResourceExists (pm .Name , controller .PowerMonitorDeploymentNS , & ds )
@@ -193,7 +194,7 @@ func TestBadPowerMonitorTaint_WithToleration(t *testing.T) {
193
194
194
195
pm := f .CreatePowerMonitor ("power-monitor" ,
195
196
f .WithPowerMonitorTolerations (append (node .Spec .Taints , badTestTaint )),
196
- f .WithPowerMonitorAnnotation (vmAnnotationKey , enableVMEnv ))
197
+ f .WithPowerMonitorAnnotation (vmAnnotationKey , strconv . FormatBool ( enableVMTest ) ))
197
198
198
199
f .AssertResourceExists (controller .PowerMonitorDeploymentNS , "" , & corev1.Namespace {})
199
200
ds := appsv1.DaemonSet {}
0 commit comments