Splitting IP address type into IPv4 and IPv6 for EndpointSlices
Kubernetes-commit: 0fa9981e0106d7f0d6f9c88fc49d4cdf779c95c1
This commit is contained in:
parent
9aa870a398
commit
4118a67aeb
|
@ -2644,11 +2644,7 @@ func describeEndpointSlice(eps *discoveryv1alpha1.EndpointSlice, events *corev1.
|
||||||
printLabelsMultiline(w, "Labels", eps.Labels)
|
printLabelsMultiline(w, "Labels", eps.Labels)
|
||||||
printAnnotationsMultiline(w, "Annotations", eps.Annotations)
|
printAnnotationsMultiline(w, "Annotations", eps.Annotations)
|
||||||
|
|
||||||
addressType := "<unset>"
|
w.Write(LEVEL_0, "AddressType:\t%s\n", string(eps.AddressType))
|
||||||
if eps.AddressType != nil {
|
|
||||||
addressType = string(*eps.AddressType)
|
|
||||||
}
|
|
||||||
w.Write(LEVEL_0, "AddressType:\t%s\n", addressType)
|
|
||||||
|
|
||||||
if len(eps.Ports) == 0 {
|
if len(eps.Ports) == 0 {
|
||||||
w.Write(LEVEL_0, "Ports: <unset>\n")
|
w.Write(LEVEL_0, "Ports: <unset>\n")
|
||||||
|
|
|
@ -3516,7 +3516,6 @@ func TestDescribeStatefulSet(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDescribeEndpointSlice(t *testing.T) {
|
func TestDescribeEndpointSlice(t *testing.T) {
|
||||||
addressTypeIP := discoveryv1alpha1.AddressTypeIP
|
|
||||||
protocolTCP := corev1.ProtocolTCP
|
protocolTCP := corev1.ProtocolTCP
|
||||||
port80 := int32(80)
|
port80 := int32(80)
|
||||||
|
|
||||||
|
@ -3525,7 +3524,7 @@ func TestDescribeEndpointSlice(t *testing.T) {
|
||||||
Name: "foo.123",
|
Name: "foo.123",
|
||||||
Namespace: "bar",
|
Namespace: "bar",
|
||||||
},
|
},
|
||||||
AddressType: &addressTypeIP,
|
AddressType: discoveryv1alpha1.AddressTypeIPv4,
|
||||||
Endpoints: []discoveryv1alpha1.Endpoint{
|
Endpoints: []discoveryv1alpha1.Endpoint{
|
||||||
{
|
{
|
||||||
Addresses: []string{"1.2.3.4", "1.2.3.5"},
|
Addresses: []string{"1.2.3.4", "1.2.3.5"},
|
||||||
|
@ -3564,7 +3563,7 @@ func TestDescribeEndpointSlice(t *testing.T) {
|
||||||
Namespace: bar
|
Namespace: bar
|
||||||
Labels: <none>
|
Labels: <none>
|
||||||
Annotations: <none>
|
Annotations: <none>
|
||||||
AddressType: IP
|
AddressType: IPv4
|
||||||
Ports:
|
Ports:
|
||||||
Name Port Protocol
|
Name Port Protocol
|
||||||
---- ---- --------
|
---- ---- --------
|
||||||
|
|
Loading…
Reference in New Issue