Skip to content

Commit

Permalink
Add back propagation/update events
Browse files Browse the repository at this point in the history
ref: https://issues.redhat.com/browse/ACM-9461
Signed-off-by: Dale Haiducek <[email protected]>
(cherry picked from commit c3c38e1)
  • Loading branch information
dhaiducek authored and Magic Mirror committed Feb 6, 2024
1 parent a4aa322 commit b3ab514
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controllers/propagator/replicatedpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ func (r *ReplicatedPolicyReconciler) Reconcile(ctx context.Context, request ctrl
return reconcile.Result{}, err
}

r.Recorder.Event(rootPolicy, "Normal", "PolicyPropagation",
fmt.Sprintf("Policy %s/%s was propagated to cluster %s/%s", rootPolicy.GetNamespace(),
rootPolicy.GetName(), decision.Cluster.ClusterName, decision.Cluster.ClusterNamespace))

version.resourceVersion = desiredReplicatedPolicy.GetResourceVersion()

log.Info("Created replicated policy")
Expand All @@ -313,6 +317,10 @@ func (r *ReplicatedPolicyReconciler) Reconcile(ctx context.Context, request ctrl
return reconcile.Result{}, err
}

r.Recorder.Event(rootPolicy, "Normal", "PolicyPropagation",
fmt.Sprintf("Policy %s/%s was updated for cluster %s/%s", rootPolicy.GetNamespace(),
rootPolicy.GetName(), decision.Cluster.ClusterName, decision.Cluster.ClusterNamespace))

log.Info("Replicated policy updated")
} else {
log.Info("Replicated policy matches, no update needed")
Expand Down

0 comments on commit b3ab514

Please sign in to comment.