Skip to content

Conversation

@TylerHelmuth
Copy link
Member

Description:
Updates the receiver to properly handle 410 response code. The expectations for what clients should do when a 410 is received can be found here: https://kubernetes.io/docs/reference/using-api/api-concepts/#410-gone-responses.

I originally implemented this feature directly in startWatch, rebuilding the watcher and res channel within the for loop, but I grew concerned about making sure everything stopped correctly. I took a look at the retry watcher's implementation and reused its concepts for this implementation. If it is overcomplicated we can go back to my original idea.

Link to tracking Issue:

Closes #24903

Testing:

Tested locally. Unit tests proved to be extremely challenging since I couldn't figure out how to get the mock to produce a 410. We really need e2e tests (#18395).

@TylerHelmuth
Copy link
Member Author

@dmitryax @evan-bradley please take another look.

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. One additional thing I noticed is that the RBAC section of the docs for this receiver should be updated to mention that list permissions should now be granted even if a resource_version is specified.

@TylerHelmuth TylerHelmuth added the ready to merge Code review completed; ready to merge by maintainers label Sep 11, 2023
@TylerHelmuth TylerHelmuth merged commit a4999eb into open-telemetry:main Sep 11, 2023
@github-actions github-actions bot added this to the next release milestone Sep 11, 2023
@TylerHelmuth TylerHelmuth deleted the k8sobject-handle-410 branch September 11, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Code review completed; ready to merge by maintainers receiver/k8sobjects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/k8sobjects] Improve handling of response code 410

3 participants