Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nil check when reading endpoint hostname #12689

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add nil check when reading endpoint hostname
Signed-off-by: Alex Leong <alex@buoyant.io>
adleong committed Jun 6, 2024
commit 52b7d68e9cff598145353abab378b85ddc9652de
2 changes: 2 additions & 0 deletions controller/api/destination/test_util.go
Original file line number Diff line number Diff line change
@@ -357,6 +357,8 @@ metadata:
kubernetes.io/service-name: statefulset-svc
addressType: IPv4
endpoints:
- addresses:
- 172.17.13.14 # Endpoint without a targetRef or hostname
- addresses:
- 172.17.13.15
hostname: pod-0
2 changes: 1 addition & 1 deletion controller/api/destination/watcher/workload_watcher.go
Original file line number Diff line number Diff line change
@@ -580,7 +580,7 @@ func (ww *WorkloadWatcher) getEndpointByHostname(hostname string, svcID *Service
}
for _, slice := range sliceList {
for _, ep := range slice.Endpoints {
if hostname == *ep.Hostname {
if ep.Hostname != nil && hostname == *ep.Hostname {
if ep.TargetRef != nil && ep.TargetRef.Kind == "Pod" {
podName := ep.TargetRef.Name
podNamespace := ep.TargetRef.Namespace

Unchanged files with check annotations Beta

for _, pod := range pods {
pod := pod
if !labels.IsTracingEnabled(&pod) {
testutil.AnnotatedWarn(t, "Tracing annotation not found on pod", pod.Namespace, pod.Name)

Check warning on line 156 in test/integration/viz/tracing/tracing_test.go

GitHub Actions / test-viz

TestTracing - Tracing annotation not found on pod
// XXX This test is super duper flakey, so for now we ignore failures when the
// annotation is missing See https://github.com/linkerd/linkerd2/issues/7538
t.SkipNow()