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")