datapath/link: Use controller to track link sync
datapath/link: Use controller to track link sync

Previously, pkg/datapath/link/ initialized an ad-hoc goroutine for
attempting to gather local link state information manually, and if an
error ever occurred, it would simply log the error and exit the
goroutine, rather than retrying.

Furthermore, this was all triggered from an init() function that would
directly initialize a package-level variable. This meant that there was
no way to mock out the implementation, and any code that imported the
link package would thereby create a direct dependency on the Linux
kernel (including any unit tests that use the package).

Factor out the implementation by introducing a constructor which creates
a controller to track the status of the link cache monitor. The public
constructor will be used to track the link cache in subsequent updates
and tidy up dependencies in other packages using dependency injection.

Signed-off-by: Joe Stringer <16a9a54ddf4259952e3c118c763138e83693d7fd@cilium.io>

michi-covalent/cilium,cilium/cilium,cilium/cilium,michi-covalent/cilium,michi-covalent/cilium,michi-covalent/cilium,michi-covalent/cilium,cilium/cilium,cilium/cilium,cilium/cilium