metropolis/node: use Event Value for network status
This moves over the GetIP API to use our fancy new event/value library.
The consumers of this data are currently the cluster manager and the
kubernetes root service. Both are migrated over.
Test Plan: Refactor, covered by E2E tests.
X-Origin-Diff: phab/D711
GitOrigin-RevId: 8a1e0dd35236d55492722f4439323cb2ee9574fc
diff --git a/metropolis/node/core/delve_enabled.go b/metropolis/node/core/delve_enabled.go
index dc17f59..24ea470 100644
--- a/metropolis/node/core/delve_enabled.go
+++ b/metropolis/node/core/delve_enabled.go
@@ -32,7 +32,11 @@
// This is intentionally delayed until network becomes available since Delve for some reason connects to itself
// and in early-boot no network interface is available to do that through. Also external access isn't possible
// early on anyways.
- networkSvc.GetIP(context.Background(), true)
+ watcher := networkSvc.Watch()
+ _, err := watcher.Get(context.Background())
+ if err != nil {
+ panic(err)
+ }
dlvCmd := exec.Command("/dlv", "--headless=true", fmt.Sprintf("--listen=:%v", node.DebuggerPort),
"--accept-multiclient", "--only-same-user=false", "attach", "--continue", "1", "/init")
if err := dlvCmd.Start(); err != nil {