Splitting IP address type into IPv4 and IPv6 for EndpointSlices

Kubernetes-commit: 0fa9981e0106d7f0d6f9c88fc49d4cdf779c95c1
This commit is contained in:
Rob Scott 2019-11-06 22:46:04 -08:00 committed by Kubernetes Publisher
parent 9aa870a398
commit 4118a67aeb
2 changed files with 3 additions and 8 deletions

View File

@ -2644,11 +2644,7 @@ func describeEndpointSlice(eps *discoveryv1alpha1.EndpointSlice, events *corev1.
printLabelsMultiline(w, "Labels", eps.Labels)
printAnnotationsMultiline(w, "Annotations", eps.Annotations)
addressType := "<unset>"
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: <unset>\n")

View File

@ -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: <none>
Annotations: <none>
AddressType: IP
AddressType: IPv4
Ports:
Name Port Protocol
---- ---- --------