Implement pod exec using a Popen like object#730
Open
iciclespider wants to merge 1 commit intokr8s-org:mainfrom
Open
Implement pod exec using a Popen like object#730iciclespider wants to merge 1 commit intokr8s-org:mainfrom
iciclespider wants to merge 1 commit intokr8s-org:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #730 +/- ##
==========================================
- Coverage 94.61% 89.13% -5.49%
==========================================
Files 29 36 +7
Lines 3141 5736 +2595
==========================================
+ Hits 2972 5113 +2141
- Misses 169 623 +454 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d66f3c5 to
18dd280
Compare
2658162 to
8f458d9
Compare
8f458d9 to
04a3d60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is very much a POC, but I believe the functionality is all there. The examples directory has a set of both async and sync examples. I created this Draft PR to get some initial feed back on the direction before doing serious polishing of the code, such as proper unit tests.
Async examples: https://github.com/iciclespider/kr8s/blob/exec-popen/examples/exec_popen.py
Sync examples: https://github.com/iciclespider/kr8s/blob/exec-popen/examples/exec_popen_sync.py
I did run into issues with sync vs async that required creating stand alone sync and async implementations. This is because the sync to async support only works for single purpose calls, but this creates the Popen object inside a context manager that then performs api calls. I am very much open to creative solutions.
Another issue is the stdin, stdout, and stderr field expose different methods in sync vs async. I would like to come up with a common set of methods, but am not sure if the sync or the async flavor should be the target.
I implemented a sync version of api.open_websocket and made a best guess on what to do. It is functional, but not very clean.
Related Issues:
pod.exec(...)withstdin#342