@@ -80,9 +80,13 @@ func (r *TestRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
80
80
return r .reconcile (ctx , req , log , k6 )
81
81
}
82
82
83
+ func isCloudTestRun (k6 v1alpha1.TestRunI ) bool {
84
+ return v1alpha1 .IsTrue (k6 , v1alpha1 .CloudTestRun ) || v1alpha1 .IsTrue (k6 , v1alpha1 .CloudPLZTestRun )
85
+ }
86
+
83
87
func (r * TestRunReconciler ) reconcile (ctx context.Context , req ctrl.Request , log logr.Logger , k6 v1alpha1.TestRunI ) (ctrl.Result , error ) {
84
88
var err error
85
- if v1alpha1 . IsTrue (k6 , v1alpha1 . CloudTestRun ) {
89
+ if isCloudTestRun (k6 ) {
86
90
// bootstrap the client
87
91
found , err := r .createClient (ctx , k6 , log )
88
92
if err != nil {
@@ -100,7 +104,7 @@ func (r *TestRunReconciler) reconcile(ctx context.Context, req ctrl.Request, log
100
104
// Decision making here is now a mix between stages and conditions.
101
105
// TODO: refactor further.
102
106
103
- if v1alpha1 . IsTrue (k6 , v1alpha1 . CloudTestRun ) && v1alpha1 .IsFalse (k6 , v1alpha1 .CloudTestRunAborted ) {
107
+ if isCloudTestRun (k6 ) && v1alpha1 .IsFalse (k6 , v1alpha1 .CloudTestRunAborted ) {
104
108
// check in with the BE for status
105
109
if r .ShouldAbort (ctx , k6 , log ) {
106
110
log .Info ("Received an abort signal from the k6 Cloud: stopping the test." )
@@ -141,7 +145,7 @@ func (r *TestRunReconciler) reconcile(ctx context.Context, req ctrl.Request, log
141
145
msg := fmt .Sprintf (errMessageTooLong , "initializer pod" , "initializer job and pod" )
142
146
log .Info (msg )
143
147
144
- if v1alpha1 . IsTrue (k6 , v1alpha1 . CloudTestRun ) {
148
+ if isCloudTestRun (k6 ) {
145
149
events := cloud .ErrorEvent (cloud .K6OperatorStartError ).
146
150
WithDetail (msg ).
147
151
WithAbort ()
0 commit comments