-
-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include "svc" as a top-level domain in the DNS resolver.
It's not uncommon that use-cases involving Kafka or other middleware use FQNs that end with "svc". The core-DNS resolver in Kubernetes can resolve such names. With this bugfix, the Telepresence DNS resolver will also be able to resolve them, and thereby remove the need to add ".svc" to the include-suffix list Closes #2814 Signed-off-by: Thomas Hallgren <[email protected]>
- Loading branch information
Showing
4 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package integration_test | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net" | ||
"time" | ||
|
||
"github.com/datawire/dlib/dlog" | ||
) | ||
|
||
func (s *connectedSuite) Test_SvcDomain() { | ||
c := s.Context() | ||
s.ApplyEchoService(c, "echo", 8080) | ||
defer s.DeleteSvcAndWorkload(c, "deploy", "echo") | ||
|
||
host := fmt.Sprintf("echo.%s.svc", s.AppNamespace()) | ||
s.Eventually(func() bool { | ||
c, cancel := context.WithTimeout(c, 1800*time.Millisecond) | ||
defer cancel() | ||
dlog.Info(c, "LookupHost("+host+")") | ||
_, err := net.DefaultResolver.LookupHost(c, host) | ||
return s.NoErrorf(err, "%s did not resolve", host) | ||
}, 10*time.Second, 2*time.Second) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters