Skip to content

Commit fd8c657

Browse files
committed
Fix IPv6 incompatibility in TestGrpcAddressCatalogSource.
The way this test was joining pod IP and port to construct CatalogSource addresses did not work when the pod IP was an IPv6 address. The test now uses net.JoinHostPort, which should do the right thing in all cases.
1 parent ffb7589 commit fd8c657

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/e2e/catalog_e2e_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package e2e
44

55
import (
66
"fmt"
7+
"net"
78
"reflect"
89
"testing"
910
"time"
@@ -499,7 +500,7 @@ func TestGrpcAddressCatalogSource(t *testing.T) {
499500
},
500501
Spec: v1alpha1.CatalogSourceSpec{
501502
SourceType: v1alpha1.SourceTypeGrpc,
502-
Address: fmt.Sprintf("%s:%s", mainCopy.Status.PodIP, "50051"),
503+
Address: net.JoinHostPort(mainCopy.Status.PodIP, "50051"),
503504
},
504505
}
505506

@@ -530,7 +531,7 @@ func TestGrpcAddressCatalogSource(t *testing.T) {
530531
// Update the catalog's address to point at the other registry pod's cluster ip
531532
addressSource, err = crc.OperatorsV1alpha1().CatalogSources(testNamespace).Get(addressSourceName, metav1.GetOptions{})
532533
require.NoError(t, err)
533-
addressSource.Spec.Address = fmt.Sprintf("%s:%s", replacementCopy.Status.PodIP, "50051")
534+
addressSource.Spec.Address = net.JoinHostPort(replacementCopy.Status.PodIP, "50051")
534535
_, err = crc.OperatorsV1alpha1().CatalogSources(testNamespace).Update(addressSource)
535536
require.NoError(t, err)
536537

0 commit comments

Comments
 (0)