From 4118a67aebcf5674429bb5492cde59354cf9d6ff Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Wed, 6 Nov 2019 22:46:04 -0800 Subject: [PATCH] Splitting IP address type into IPv4 and IPv6 for EndpointSlices Kubernetes-commit: 0fa9981e0106d7f0d6f9c88fc49d4cdf779c95c1 --- pkg/describe/versioned/describe.go | 6 +----- pkg/describe/versioned/describe_test.go | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pkg/describe/versioned/describe.go b/pkg/describe/versioned/describe.go index 315ac742..8155aa1f 100644 --- a/pkg/describe/versioned/describe.go +++ b/pkg/describe/versioned/describe.go @@ -2644,11 +2644,7 @@ func describeEndpointSlice(eps *discoveryv1alpha1.EndpointSlice, events *corev1. printLabelsMultiline(w, "Labels", eps.Labels) printAnnotationsMultiline(w, "Annotations", eps.Annotations) - addressType := "" - if eps.AddressType != nil { - addressType = string(*eps.AddressType) - } - w.Write(LEVEL_0, "AddressType:\t%s\n", addressType) + w.Write(LEVEL_0, "AddressType:\t%s\n", string(eps.AddressType)) if len(eps.Ports) == 0 { w.Write(LEVEL_0, "Ports: \n") diff --git a/pkg/describe/versioned/describe_test.go b/pkg/describe/versioned/describe_test.go index 5236f4f2..48c43f58 100644 --- a/pkg/describe/versioned/describe_test.go +++ b/pkg/describe/versioned/describe_test.go @@ -3516,7 +3516,6 @@ func TestDescribeStatefulSet(t *testing.T) { } func TestDescribeEndpointSlice(t *testing.T) { - addressTypeIP := discoveryv1alpha1.AddressTypeIP protocolTCP := corev1.ProtocolTCP port80 := int32(80) @@ -3525,7 +3524,7 @@ func TestDescribeEndpointSlice(t *testing.T) { Name: "foo.123", Namespace: "bar", }, - AddressType: &addressTypeIP, + AddressType: discoveryv1alpha1.AddressTypeIPv4, Endpoints: []discoveryv1alpha1.Endpoint{ { Addresses: []string{"1.2.3.4", "1.2.3.5"}, @@ -3564,7 +3563,7 @@ func TestDescribeEndpointSlice(t *testing.T) { Namespace: bar Labels: Annotations: -AddressType: IP +AddressType: IPv4 Ports: Name Port Protocol ---- ---- --------