Skip to content

fix: guard nil ExternalWorkload in opaque protocol (#15551) - #15575

Open
qoire wants to merge 1 commit into
linkerd:mainfrom
qoire:fix-externalworkload-delete-panic
Open

fix: guard nil ExternalWorkload in opaque protocol (#15551)#15575
qoire wants to merge 1 commit into
linkerd:mainfrom
qoire:fix-externalworkload-delete-panic

Conversation

@qoire

@qoire qoire commented Aug 13, 2026

Copy link
Copy Markdown

Deleting an ExternalWorkload panics linkerd-destination when a proxy holds a discovery subscription for that workload's IP:port. submitExternalWorkloadUpdate passes nil on removal; the ownership block above guards for it, the opaque protocol error branch does not — and that branch always runs on removal, since SetToServerProtocolExternalWorkload errors unconditionally on a nil workload.

Skips the computation when the workload is nil. Listeners are still notified.

Fixes #15551

@qoire
qoire requested a review from a team as a code owner August 13, 2026 14:56
)

Problem

`submitExternalWorkloadUpdate` passes nil on removal, and the opaque
protocol error branch dereferences it, panicking `linkerd-destination`
whenever a subscribed ExternalWorkload is deleted.

Solution

Skip the computation when the workload is nil.

Validation

`go test ./controller/api/destination/watcher/...`

Fixes linkerd#15551

Signed-off-by: Yao Sun <mr.sun.yao@gmail.com>
@qoire
qoire force-pushed the fix-externalworkload-delete-panic branch from de4c723 to e6f5039 Compare August 13, 2026 15:02
@qoire qoire changed the title Guard nil ExternalWorkload in opaque protocol computation (#15551) fix: guard nil ExternalWorkload in opaque protocol computation (#15551) Aug 13, 2026
@qoire qoire changed the title fix: guard nil ExternalWorkload in opaque protocol computation (#15551) fix: guard nil ExternalWorkload in opaque protocol (#15551) Aug 13, 2026
@adleong
adleong self-requested a review August 14, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linkerd-destination panics with a nil pointer dereference when an ExternalWorkload is deleted

1 participant