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 ---- ---- --------