Skip to content

Commit

Permalink
Merge pull request #101632 from robscott/automated-cherry-pick-of-#10…
Browse files Browse the repository at this point in the history
…1025-release-1.21

Automated cherry pick of #101025: Fix EndpointSlice describe panic when an Endpoint doesn't

Kubernetes-commit: 19619bd861bb01c5ff0c85a68c4bf441dabca34d
  • Loading branch information
k8s-publishing-bot committed May 18, 2021
2 parents 45c9920 + f08761f commit 8848261
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/describe/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -3055,7 +3055,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)
Expand Down
3 changes: 2 additions & 1 deletion pkg/describe/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -4906,7 +4907,7 @@ Endpoints:
Ready: true
Hostname: <unset>
TargetRef: Pod/test-124
NodeName: <unset>
NodeName: node-2
Zone: <unset>
Events: <none>` + "\n",
},
Expand Down

0 comments on commit 8848261

Please sign in to comment.