Skip to content

Commit

Permalink
Replace localhost with 127.0.0.1 to prevent DNS resolving problem (fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
life1347 authored Jul 12, 2019
1 parent c1cb960 commit b0b29da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,14 +615,17 @@ func (fetcher *Fetcher) SpecializePod(ctx context.Context, fetchReq types.Functi
return errors.Wrap(err, "error encoding load request")
}

// Instead of using "localhost", here we use "127.0.0.1" for
// inter-pod communication to prevent wrongly record returned from DNS.

if loadReq.EnvVersion >= 2 {
contentType = "application/json"
specializeURL = "https://localhost:8888/v2/specialize"
specializeURL = "https://127.0.0.1:8888/v2/specialize"
reader = bytes.NewReader(loadPayload)
fetcher.logger.Info("calling environment v2 specialization endpoint")
} else {
contentType = "text/plain"
specializeURL = "https://localhost:8888/specialize"
specializeURL = "https://127.0.0.1:8888/specialize"
reader = bytes.NewReader([]byte{})
fetcher.logger.Info("calling environment v1 specialization endpoint")
}
Expand Down

0 comments on commit b0b29da

Please sign in to comment.