Skip to content

Commit

Permalink
Merge pull request #2929 from cyclinder/spidercoorinator/update_status
Browse files Browse the repository at this point in the history
spidercoordinator: It should update the status to NotReady if any errors occur
  • Loading branch information
weizhoublue authored and robot committed Dec 18, 2023
1 parent 8b4f017 commit d488276
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 d488276

Please sign in to comment.