From b3ab514b92fdc48dacaa849418a3293e01e3ed9e Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:34:22 -0500 Subject: [PATCH] Add back propagation/update events ref: https://issues.redhat.com/browse/ACM-9461 Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> (cherry picked from commit c3c38e19a25d98abf40bcb92566a881c3dc377fd) --- controllers/propagator/replicatedpolicy_controller.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/propagator/replicatedpolicy_controller.go b/controllers/propagator/replicatedpolicy_controller.go index 639fd8ee..847d94cb 100644 --- a/controllers/propagator/replicatedpolicy_controller.go +++ b/controllers/propagator/replicatedpolicy_controller.go @@ -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") @@ -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")