@@ -12,8 +12,6 @@ import (
1212 "k8s.io/apimachinery/pkg/watch"
1313 "k8s.io/client-go/tools/cache"
1414 "k8s.io/client-go/util/workqueue"
15- "k8s.io/klog/v2"
16-
1715 workv1 "open-cluster-management.io/api/work/v1"
1816
1917 "open-cluster-management.io/sdk-go/pkg/cloudevents/clients/store"
@@ -167,7 +165,6 @@ func (s *AgentInformerWatcherStore) Delete(resource runtime.Object) error {
167165}
168166
169167func (s * AgentInformerWatcherStore ) HandleReceivedResource (ctx context.Context , action types.ResourceAction , work * workv1.ManifestWork ) error {
170- logger := klog .FromContext (ctx )
171168 switch action {
172169 case types .Added :
173170 return s .Add (work .DeepCopy ())
@@ -179,15 +176,14 @@ func (s *AgentInformerWatcherStore) HandleReceivedResource(ctx context.Context,
179176 if ! exists {
180177 return fmt .Errorf ("the work %s/%s does not exist" , work .Namespace , work .Name )
181178 }
179+
180+ updatedWork := work .DeepCopy ()
181+
182182 // prevent the work from being updated if it is deleting
183183 if ! lastWork .GetDeletionTimestamp ().IsZero () {
184- logger .Info ("the work is deleting, ignore the update" ,
185- "manifestWorkNamespace" , work .Namespace , "manifestWorkName" , work .Name )
186- return nil
184+ updatedWork .SetDeletionTimestamp (lastWork .DeletionTimestamp )
187185 }
188186
189- updatedWork := work .DeepCopy ()
190-
191187 // restore the fields that are maintained by local agent.
192188 updatedWork .Finalizers = lastWork .Finalizers
193189 updatedWork .Status = lastWork .Status
0 commit comments