-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add cloud CLI tunnel command #1552
Conversation
ea9c548
to
d8c9ab2
Compare
8fe52c1
to
68bbd1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried this out locally,
was able to:
- login
- successfully create a tunnel
- register a service
- invoke it.
- re attach to a previously created tunnel
- use non standard local network configuration
So functionality wise looks really good to me.
Running tunnel without any parameters works fine, but when I start it with any remote-port arguments and NO local-port argument, the CLI crashes:
But for example these all work just fine:
|
|
||
loop { | ||
tokio::select! { | ||
Err(local_err) = &mut local_fut => break Err(Error::Local(local_err)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panic on setting a remote-port but no local-port goes away if I change this line to:
Err(local_err) = &mut local_fut => break Err(Error::Local(local_err)), | |
Err(local_err) = &mut local_fut, if opts.local_port.is_some() => break Err(Error::Local(local_err)), |
Though I'm not sure why it works that way, since local_fut
should evaluate to Ok(())
when local port is unset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I suspect I'm using select subtly wrong. Will take a look and report back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fuse the future otherwise it will panic when polled again after already returning Poll::Ready(Ok(())). Bit of a footgun with tokio::select!.
https://users.rust-lang.org/t/why-doesnt-tokio-select-require-fusedfuture/46975/13
Adds a command that can expose a local port to restate cloud
BInary size impact; 475kB