We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
kr8s
When I run the following snippet in IPython I get an error.
import kr8s try: pod = kr8s.objects.Pod.gen(name="test-pod", image="nginx:latest", ports=[{"containerPort": 80}]) pod.create() with pod.portforward(80) as port: print(port) finally: pod.delete()
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) Cell In[1], line 5 3 pod = kr8s.objects.Pod.gen(name="test-pod", image="nginx:latest", ports=[{"containerPort": 80}]) 4 pod.create() ----> 5 with pod.portforward(80) as port: 6 print(port) 7 finally: File ~/Projects/kr8s-org/kr8s/kr8s/_objects.py:856, in Pod.portforward(self, remote_port, local_port, address) 854 if self._asyncio: 855 return AsyncPortForward(self, remote_port, local_port, address) --> 856 return SyncPortForward(self, remote_port, local_port, address) File ~/Projects/kr8s-org/kr8s/kr8s/_portforward.py:104, in PortForward.__init__(self, resource, remote_port, local_port, address) 102 self._resource = resource 103 self.pod = None --> 104 self._loop = asyncio.get_event_loop() 105 self._tasks = [] 106 self._run_task = None File ~/miniconda3/envs/kr8s/lib/python3.11/asyncio/events.py:677, in BaseDefaultEventLoopPolicy.get_event_loop(self) 674 self.set_event_loop(self.new_event_loop()) 676 if self._local._loop is None: --> 677 raise RuntimeError('There is no current event loop in thread %r.' 678 % threading.current_thread().name) 680 return self._local._loop RuntimeError: There is no current event loop in thread 'MainThread'.
Running this in the standard Python REPL or in a script doesn't reproduce the issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Which project are you reporting a bug for?
kr8s
What happened?
When I run the following snippet in IPython I get an error.
Anything else?
Running this in the standard Python REPL or in a script doesn't reproduce the issue.
The text was updated successfully, but these errors were encountered: