Skip to content

Commit

Permalink
spidercoordinator: Fix don't update status if error return
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder committed Dec 15, 2023
1 parent b9e6d82 commit b6bbd2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/coordinatormanager/coordinator_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,14 @@ func (cc *CoordinatorController) syncHandler(ctx context.Context, coordinatorNam
coordCopy, err = cc.fetchPodAndServerCIDR(ctx, logger, coordCopy)
if err != nil {
logger.Sugar().Errorf("failed to handle spidercoordinator: %v", err)
return err
}

if !reflect.DeepEqual(coordCopy.Status, coord.Status) {
if err = cc.Client.Status().Patch(ctx, coordCopy, client.MergeFrom(coord)); err != nil {
logger.Sugar().Errorf("failed to patch spidercoordinator phase: %v", err.Error())
return err
}
logger.Sugar().Infof("Success to patch coordinator's status to %v", coordCopy.Status)
}

return
Expand Down

0 comments on commit b6bbd2c

Please sign in to comment.