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

Fix unchecked cast panic in traffic-manager pod watcher. #3153

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

thallgren
Copy link
Member

Description

A watcher isn't guaranteed to always receive an object of the watched type. The DeleteFunc in particular, can receive an instance of cache.DeleteFinalStateUnknown. This commit ensures that the traffic-manager's node and pod watcher uses checked casts only and that the cache.DeleteFinalStateUnknown is handled properly.

Closes #3149

Checklist

  • I made sure to update ./CHANGELOG.md.
  • I made sure to add any docs changes required for my change (including release notes).
  • My change is adequately tested.
  • I updated DEVELOPING.md with any any special dev tricks I had to use to work on this code efficiently.
  • I updated TELEMETRY.md if I added, changed, or removed a metric name.
  • Once my PR is ready to have integration tests ran, I posted the PR in #telepresence-dev in the datawire-oss slack so that the "ok to test" label can be applied.

A watcher isn't guaranteed to always receive an object of the watched
type. The `DeleteFunc` in particular, can receive an instance of
`cache.DeleteFinalStateUnknown`. This commit ensures that the traffic-
manager's node and pod watcher uses checked casts only and that the
`cache.DeleteFinalStateUnknown` is handled properly.

Closes #3149

Signed-off-by: Thomas Hallgren <[email protected]>
@thallgren thallgren added the ok to test Applied by maintainers when a PR is ready to have tests run on it label Apr 28, 2023
@thallgren thallgren self-assigned this Apr 28, 2023
@github-actions github-actions bot removed the ok to test Applied by maintainers when a PR is ready to have tests run on it label Apr 28, 2023
@thallgren thallgren requested review from a team and njayp and removed request for a team April 28, 2023 11:18
@thallgren thallgren merged commit a06b94a into release/v2 Apr 28, 2023
@thallgren thallgren deleted the thallgren/tm-cast-panic branch April 28, 2023 21:17
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.

Traffic Manager crashes: Observed a panic: &runtime.TypeAssertionError
2 participants