From 9db5af67a7d026664eac5b2879db2103c96443cc Mon Sep 17 00:00:00 2001 From: Olha Yevtushenko Date: Fri, 6 May 2022 17:06:58 +0300 Subject: [PATCH] cloud output: add logging of stages --- controllers/k6_create.go | 1 + controllers/k6_finish.go | 1 + controllers/k6_initialize.go | 2 ++ controllers/k6_start.go | 1 + 4 files changed, 5 insertions(+) diff --git a/controllers/k6_create.go b/controllers/k6_create.go index bdc3a1d2..12c5479b 100644 --- a/controllers/k6_create.go +++ b/controllers/k6_create.go @@ -25,6 +25,7 @@ func CreateJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Reco return res, err } + log.Info("Changing stage of K6 status to created") k6.Status.Stage = "created" if err = r.Client.Status().Update(ctx, k6); err != nil { log.Error(err, "Could not update status of custom resource") diff --git a/controllers/k6_finish.go b/controllers/k6_finish.go index 44671e18..8dffd10f 100644 --- a/controllers/k6_finish.go +++ b/controllers/k6_finish.go @@ -77,6 +77,7 @@ func FinishJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Reco } } + log.Info("Changing stage of K6 status to finished") k6.Status.Stage = "finished" if err = r.Client.Status().Update(ctx, k6); err != nil { log.Error(err, "Could not update status of custom resource") diff --git a/controllers/k6_initialize.go b/controllers/k6_initialize.go index 5d0513d0..8d804a12 100644 --- a/controllers/k6_initialize.go +++ b/controllers/k6_initialize.go @@ -35,6 +35,7 @@ var ( func InitializeJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Reconciler) (res ctrl.Result, err error) { log.Info("Initialize test") + log.Info("Changing stage of K6 status to initialization") k6.Status.Stage = "initialization" if err = r.Client.Status().Update(ctx, k6); err != nil { log.Error(err, "Could not update status of custom resource") @@ -190,6 +191,7 @@ func InitializeJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6 return } + log.Info("Changing stage of K6 status to initialized") k6.Status.Stage = "initialized" if err = r.Client.Status().Update(ctx, k6); err != nil { log.Error(err, "Could not update status of custom resource") diff --git a/controllers/k6_start.go b/controllers/k6_start.go index 10af9b7a..4cc90f14 100644 --- a/controllers/k6_start.go +++ b/controllers/k6_start.go @@ -96,6 +96,7 @@ func StartJobs(ctx context.Context, log logr.Logger, k6 *v1alpha1.K6, r *K6Recon return ctrl.Result{}, err } + log.Info("Changing stage of K6 status to started") k6.Status.Stage = "started" if err = r.Client.Status().Update(ctx, k6); err != nil { log.Error(err, "Could not update status of custom resource")