ipam: Consolidate logic to sync to K8s apiserver
ipam: Consolidate logic to sync to K8s apiserver

In (*Node).syncToAPIServer(), there are two main loops (operations)
which update the CiliumNode status and spec, respectively. The code was
exactly the same except for this difference. This commit refactors the
logic to consolidate the code when syncing to the CiliumNode resource to
the apiserver.

In addition, this refactor allows these two operations to have the same
erorr handling flow [see commit a7451f82d4 ("ipam: Warn when failing to
update CN status")]. The main motivation for that commit is to fix the
swallowing of the error when update fails and the subsequent Get
succeeds. Before this commit, the error handling flow was different
between the two operations (update spec & status).

Signed-off-by: Chris Tarazi <711c73f64afdce07b7e38039a96d2224209e9a6c@isovalent.com>

michi-covalent/cilium,michi-covalent/cilium,cilium/cilium,tklauser/cilium,tgraf/cilium,tgraf/cilium,michi-covalent/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,tgraf/cilium,tklauser/cilium,michi-covalent/cilium,tgraf/cilium,tgraf/cilium,cilium/cilium,cilium/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,tklauser/cilium