Fix EndpointSlice describe panic when an Endpoint doesn't have zone
Kubernetes-commit: 67494b169413c74c116cf4c238c266810729247a
This commit is contained in:
parent
7cc9aa31e2
commit
a78d4d9ab3
|
@ -3087,7 +3087,7 @@ func describeEndpointSliceV1(eps *discoveryv1.EndpointSlice, events *corev1.Even
|
|||
w.Write(LEVEL_2, "NodeName:\t%s\n", nodeNameText)
|
||||
|
||||
zoneText := "<unset>"
|
||||
if endpoint.NodeName != nil {
|
||||
if endpoint.Zone != nil {
|
||||
zoneText = *endpoint.Zone
|
||||
}
|
||||
w.Write(LEVEL_2, "Zone:\t%s\n", zoneText)
|
||||
|
|
|
@ -4874,6 +4874,7 @@ Events: <none>` + "\n",
|
|||
Addresses: []string{"1.2.3.6", "1.2.3.7"},
|
||||
Conditions: discoveryv1.EndpointConditions{Ready: utilpointer.BoolPtr(true)},
|
||||
TargetRef: &corev1.ObjectReference{Kind: "Pod", Name: "test-124"},
|
||||
NodeName: utilpointer.StringPtr("node-2"),
|
||||
},
|
||||
},
|
||||
Ports: []discoveryv1.EndpointPort{
|
||||
|
@ -4906,7 +4907,7 @@ Endpoints:
|
|||
Ready: true
|
||||
Hostname: <unset>
|
||||
TargetRef: Pod/test-124
|
||||
NodeName: <unset>
|
||||
NodeName: node-2
|
||||
Zone: <unset>
|
||||
Events: <none>` + "\n",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue