services/device/internal/starter: Log proxied address.
Log the proxied address of unclaimed device managers. Since unclaimed
devices can't published themselves in the namespace anymore, we need a
way to figure out how to reach them.
Change-Id: Ibcf664ac30dc08d15374af1622e334da2698a22b
diff --git a/services/device/internal/starter/starter.go b/services/device/internal/starter/starter.go
index b0a636c..d0e814e 100644
--- a/services/device/internal/starter/starter.go
+++ b/services/device/internal/starter/starter.go
@@ -184,6 +184,18 @@
shutdown()
return nil, err
}
+ if args.Device.ListenSpec.Proxy != "" {
+ for {
+ p := server.Status().Proxies
+ if len(p) == 0 {
+ vlog.Infof("Waiting for proxy address to appear...")
+ time.Sleep(time.Second)
+ continue
+ }
+ vlog.Infof("Proxied address: %s", p[0].Endpoint.Name())
+ break
+ }
+ }
vlog.Infof("Unclaimed device manager (%v) published as %v with public_key: %s", endpoints[0].Name(), claimableServerName, base64.URLEncoding.EncodeToString(publicKey))
vlog.FlushLog()
return shutdown, nil