diff --git a/controllers/k6_controller.go b/controllers/k6_controller.go index c6b0758a..d6641550 100644 --- a/controllers/k6_controller.go +++ b/controllers/k6_controller.go @@ -62,7 +62,7 @@ func (r *K6Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { case "created": return StartJobs(ctx, log, k6, r) case "started": - return ReconcileJobs(ctx, log, k6, r) + return FinishJobs(ctx, log, k6, r) case "finished": // delete if configured if k6.Spec.Cleanup == "post" { diff --git a/controllers/k6_reconcile.go b/controllers/k6_finish.go similarity index 88% rename from controllers/k6_reconcile.go rename to controllers/k6_finish.go index 2fdff42f..b7fb9550 100644 --- a/controllers/k6_reconcile.go +++ b/controllers/k6_finish.go @@ -12,8 +12,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -// Reconcile k6 status with job status -func ReconcileJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Reconciler) (ctrl.Result, error) { +// Mark k6 as finished as jobs finish +func FinishJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Reconciler) (ctrl.Result, error) { selector := labels.SelectorFromSet(map[string]string{ "app": "k6", "k6_cr": k6.Name,