@@ -153,10 +153,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req runtime.Request) (runtim
153153 "placement" , placementObjRef )
154154 return runtime.Result {}, err
155155 }
156- if masterResourceSnapshot == nil {
157- err := controller .NewUnexpectedBehaviorError (fmt .Errorf ("no masterResourceSnapshot found for the placement %s" , placementKey ))
158- return runtime.Result {}, err
159- }
160156 klog .V (2 ).InfoS ("Found the masterResourceSnapshot for the placement" , "placement" , placementObjRef , "masterResourceSnapshot" , klog .KObj (masterResourceSnapshot ))
161157
162158 // Note: there is a corner case that an override is in-between snapshots (the old one is marked as not the latest while the new one is not created yet)
@@ -701,16 +697,6 @@ func (r *Reconciler) SetupWithManager(mgr runtime.Manager) error {
701697 handleResourceSnapshot (e .Object , q )
702698 },
703699 }).
704- Watches (& fleetv1beta1.ResourceSnapshot {}, handler.Funcs {
705- CreateFunc : func (ctx context.Context , e event.CreateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
706- klog .V (2 ).InfoS ("Handling a resource snapshot create event" , "resourceSnapshot" , klog .KObj (e .Object ))
707- handleResourceSnapshot (e .Object , q )
708- },
709- GenericFunc : func (ctx context.Context , e event.GenericEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
710- klog .V (2 ).InfoS ("Handling a resource snapshot generic event" , "resourceSnapshot" , klog .KObj (e .Object ))
711- handleResourceSnapshot (e .Object , q )
712- },
713- }).
714700 Watches (& fleetv1alpha1.ClusterResourceOverrideSnapshot {}, handler.Funcs {
715701 CreateFunc : func (ctx context.Context , e event.CreateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
716702 klog .V (2 ).InfoS ("Handling a clusterResourceOverrideSnapshot create event" , "clusterResourceOverrideSnapshot" , klog .KObj (e .Object ))
@@ -778,19 +764,6 @@ func (r *Reconciler) SetupWithManager(mgr runtime.Manager) error {
778764 enqueueResourceBinding (e .Object , q )
779765 },
780766 }).
781- Watches (& fleetv1beta1.ResourceBinding {}, handler.Funcs {
782- CreateFunc : func (ctx context.Context , e event.CreateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
783- klog .V (2 ).InfoS ("Handling a resource binding create event" , "resourceBinding" , klog .KObj (e .Object ))
784- enqueueResourceBinding (e .Object , q )
785- },
786- UpdateFunc : func (ctx context.Context , e event.UpdateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
787- handleResourceBindingUpdated (e .ObjectNew , e .ObjectOld , q )
788- },
789- GenericFunc : func (ctx context.Context , e event.GenericEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
790- klog .V (2 ).InfoS ("Handling a resource binding generic event" , "resourceBinding" , klog .KObj (e .Object ))
791- enqueueResourceBinding (e .Object , q )
792- },
793- }).
794767 // Aside from resource snapshot and binding objects, the rollout
795768 // controller also watches placement objects (ClusterResourcePlacement and ResourcePlacement),
796769 // so that it can push apply strategy updates to all bindings right away.
@@ -800,12 +773,6 @@ func (r *Reconciler) SetupWithManager(mgr runtime.Manager) error {
800773 handlePlacement (e .ObjectNew , e .ObjectOld , q )
801774 },
802775 }).
803- Watches (& fleetv1beta1.ResourcePlacement {}, handler.Funcs {
804- // Ignore all Create, Delete, and Generic events; these do not concern the rollout controller.
805- UpdateFunc : func (ctx context.Context , e event.UpdateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
806- handlePlacement (e .ObjectNew , e .ObjectOld , q )
807- },
808- }).
809776 Complete (r )
810777}
811778
0 commit comments