Skip to content

Commit

Permalink
Use IPv6 in resolver cache tests
Browse files Browse the repository at this point in the history
Use "::1/128" instead of 127.0.0.1
  • Loading branch information
adambkaplan committed Dec 19, 2019
1 parent 859877b commit f4f956d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ func TestServiceResolverCache(t *testing.T) {
c = fakeRetriever{
service: &corev1.Service{
Spec: corev1.ServiceSpec{
ClusterIP: "127.0.0.1",
ClusterIP: "::1/128",
Ports: []corev1.ServicePort{{Port: 80}},
},
},
}
cache = newServiceResolverCache(c.Get)
if v, ok := cache.resolve("FOO_SERVICE_HOST"); v != "127.0.0.1" || !ok {
if v, ok := cache.resolve("FOO_SERVICE_HOST"); v != "::1/128" || !ok {
t.Errorf("unexpected cache item")
}
if v, ok := cache.resolve("FOO_SERVICE_PORT"); v != "80" || !ok {
Expand All @@ -83,10 +83,10 @@ func TestServiceResolverCache(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if v, ok := fn(); v != "127.0.0.1" || !ok {
if v, ok := fn(); v != "::1/128" || !ok {
t.Errorf("unexpected cache item")
}
if v, ok := fn(); v != "127.0.0.1" || !ok {
if v, ok := fn(); v != "::1/128" || !ok {
t.Errorf("unexpected cache item")
}
}

0 comments on commit f4f956d

Please sign in to comment.