Skip to content

Commit

Permalink
emit events
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkarlsen committed Sep 8, 2023
1 parent 3ecd71f commit f9c1098
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controller/migration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f9c1098

Please sign in to comment.