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

Capture Manager should use contexts #317

Closed
timraymond opened this issue Apr 25, 2024 · 0 comments · Fixed by #1307
Closed

Capture Manager should use contexts #317

timraymond opened this issue Apr 25, 2024 · 0 comments · Fixed by #1307
Assignees
Labels
good first issue Good for newcomers lang/go The Go Programming Language priority/2 P2 scope/M Change is Medium type/enhancement New feature or request

Comments

@timraymond
Copy link
Member

CaptureManager is often responsible for interacting with multiple APIs, including the k8s apiserver. It's apparent from PRs that add new functionality to CaptureManager that there is many context.TODO()s in places where these interactions take place (see: https://github.com/microsoft/retina/pull/295/files#diff-99babd138c7f336f6abec8bd499b3593610bad046a34d47e8d448a7600040c7bR104) . This could be added with a bit of work, binding to the os.Signal channel. While this might ultimately yield the same result, it at least establishes a context heirarchy that will be more easily iterated on in the future.

@rbtr rbtr self-assigned this Apr 25, 2024
@rbtr rbtr moved this to Accepted in Retina Triage Board Apr 25, 2024
@rbtr rbtr added type/enhancement New feature or request good first issue Good for newcomers lang/go The Go Programming Language priority/2 P2 scope/M Change is Medium labels Apr 25, 2024
@kamilprz kamilprz self-assigned this Dec 31, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 10, 2025
# Description

Refactoring the capture manager and capture commands to create a context
hierarchy by passing it around, rather than creating a new one in each
method with `context.TODO`.

## Related Issue

#317

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [ ] I have updated the documentation, if necessary.
- [ ] I have added tests, if applicable.

## Additional Notes

https://go.dev/blog/context

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.

---------

Signed-off-by: Kamil <[email protected]>
@kamilprz kamilprz linked a pull request Feb 10, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers lang/go The Go Programming Language priority/2 P2 scope/M Change is Medium type/enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants