From f9c1098f941b6327a4fee6fca10bf9ff22cac7e4 Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Fri, 8 Sep 2023 14:00:00 +0200 Subject: [PATCH] emit events --- internal/controller/migration_controller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/controller/migration_controller.go b/internal/controller/migration_controller.go index 25be20f..e3e42c8 100644 --- a/internal/controller/migration_controller.go +++ b/internal/controller/migration_controller.go @@ -71,6 +71,7 @@ func (r *MigrationReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if util.IsBeingDeleted(migration) { logger.Info("Migration deleted, returning") + r.GetRecorder().Event(migration, v12.EventTypeWarning, "Deleting", fmt.Sprintf("Migration deleted: %s", req.NamespacedName)) return r.ManageSuccess(ctx, migration) } @@ -103,6 +104,7 @@ func (r *MigrationReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if existingJob.Status.Succeeded > 0 { logger.Info("Job succeeded - removing") //TODO - should match hash + r.GetRecorder().Event(migration, v12.EventTypeNormal, "Succeeded", fmt.Sprintf("Migration Succeeded: %s", req.NamespacedName)) err := r.deleteExistingJob(ctx, existingJob) if err != nil {