Skip to content

Commit

Permalink
cloud output: add logging of stages
Browse files Browse the repository at this point in the history
  • Loading branch information
yorugac committed May 13, 2022
1 parent 0a72b7c commit 9db5af6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/k6_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions controllers/k6_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions controllers/k6_initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions controllers/k6_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9db5af6

Please sign in to comment.