Skip to content

Commit

Permalink
Ensure kolide URL is set before doing DNS check
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jan 8, 2024
1 parent a223e71 commit 1278039
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func runLauncher(ctx context.Context, cancel func(), slogger, systemSlogger *mul
// Note that the SplitN won't work for bare ip6 addresses.
if err := backoff.WaitFor(func() error {
hostport := strings.SplitN(opts.KolideServerURL, ":", 2)
if len(hostport) < 1 {
return fmt.Errorf("unable to parse url: %s", opts.KolideServerURL)
}
_, lookupErr := net.LookupIP(hostport[0])
return lookupErr
}, 10*time.Second, 1*time.Second); err != nil {
Expand Down

0 comments on commit 1278039

Please sign in to comment.