node: shorten hostname for load testing

This commit is contained in:
Evan Gray 2024-04-25 14:48:06 -04:00 committed by Evan Gray
parent 034c570b33
commit e6dfb9115e
1 changed files with 6 additions and 0 deletions

View File

@ -1003,10 +1003,16 @@ func runNode(cmd *cobra.Command, args []string) {
if idx != 0 {
// try to connect to guardian-0
for {
// tilt uses this hostname format
_, err := net.LookupIP("guardian-0.guardian")
if err == nil {
break
}
// load tests use this hostname format
_, err = net.LookupIP("guardian-0")
if err == nil {
break
}
logger.Info("Error resolving guardian-0.guardian. Trying again...")
time.Sleep(time.Second)
}