mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #101025 from tnqn/describe-endpointslice-panic
Fix EndpointSlice describe panic when an Endpoint doesn't have zone
This commit is contained in:
commit
3fcd8398c7
@ -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
Block a user