-
Notifications
You must be signed in to change notification settings - Fork 62
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 --rm mode for inletsctl create #45
Conversation
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 think we can get the code a bit clearer before merging. Separation of concerns will make this easier to maintain
I don't think this shouldn't work when the user hasn't specified an upstream port, can you show an error? |
Also can you think why I got an auth error?
|
Hmm it was |
Please give an example showing --rm and how to invoke it with port in the CMD help text? |
The inlets-pro error is perhaps because the server takes a little while to come up, in which case you should retry the tunnel for let's say 5 times with a small pause between? |
Thanks a lot! I'll keep this feedback in mind for the next commit push.
…On Thu, Feb 6, 2020, 1:37 AM Alex Ellis ***@***.***> wrote:
The inlets-pro error is perhaps because the server takes a little while to
come up, in which case you should retry the tunnel for let's say 5 times
with a small pause between?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#45?email_source=notifications&email_token=AGAYDROYHXIIE5VG75MZA4DRBML7BA5CNFSM4KPJU6QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK4ZPBY#issuecomment-582588295>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGAYDROF7IORBF3HR3UX2ZLRBML7BANCNFSM4KPJU6QA>
.
|
I'm using a default value for the upstream, http://127.0.0.1:3000, I think we should log it while creating the tunnel saying, using the default value for upstream http://127.0.0.1:3000 What do you think? |
The output needs some work too, we should be using StreamStdio so that we get a live printout of the child process. Instead I only see this when I hit control + c:
|
No, don't use a default, if --rm is given, the user must change the port or specify remote-tcp. |
The behaviour looks different between create + delete, vs --rm then control+c - the ID wasn't printed out.
|
Your version of Also - you'll need to use Command for only the first part of the text, and Args[] for everything else. Please can you change that? |
Sure @alexellis I'll do this! |
Thanks a lot for the feedback! |
You're going to need a rebase now, because I've added go modules. After rebasing from master, run:
|
Hi @utsavanand2 I noticed the issue title now says "fix issue with GCE running inlets-pro" Didn't I merge that fix via another PR? If so, please could you rebase this PR against master and then edit the title to remove that part? |
@alexellis Sir I think I just need to change the title because this PR changes opens up all ports for running inlets-pro (specifically allowing all ports a user can use with |
Sure! |
b4bba83
to
13b7f9d
Compare
70e02da
to
98f3cbe
Compare
80c67b9
to
c1fa6b8
Compare
12cba05
to
ebdf87e
Compare
cmd/create.go
Outdated
fmt.Printf("Your IP is: %s\n", hostStatus.IP) | ||
|
||
var err error = nil | ||
ctx, cancelFunction := context.WithCancel(context.Background()) |
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.
@viveksyngh I would love to have your feedback on this. Even after passing a req context to checkServiceUp() we're not able to cancel our request and exit out.
@viveksyngh I would love to have your feedback on the code, especially where we're creating and passing the context https://github.com/inlets/inletsctl/pull/45/files#r396123320 |
@viveksyngh - I think there's been two members meetings where you've agreed to take a look at this, are you still able to assist or should we find someone else? |
I will have look at it this weekend. |
I have created this PR to utsav branch to fix the issue which @utsavanand2 is facing. cc @alexellis |
|
||
go func() { | ||
sigval, ok := <-sig | ||
fmt.Printf("\n%v\n", sigval) |
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 think after receiving the signal, you need to call the cancel function as soon as possible, so that context can be canceled and http request being made in checkServiceUp should pause and return from there. For that you might need to move cancelFunction() inside this go routine. There will other changes required as well for that.
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.
Since function will also return from there, you need to make sure that you delete the instance as well. for that you will have to one more goroutine to delete that. I have these changes in my local and I will raise a PR to this branch .
Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide. |
an upstream or a remote-tcp and will delete the exit-node on a SIGINT (control + c) Huge thanks to @viveksyngh for helping me out with the context cancellation bug! Fixes inlets#41 Signed-off-by: Utsav Anand <[email protected]>
@alexellis I think we're ready to merge this PR now so we can take advantage of the new feature |
@viveksyngh Thanks a lot for helping me out! |
The --rm flag (default true) will enable to point to
an upstream or a remote-tcp and will delete the exit-node
on a SIGINT (control + c)
Fixes #41
Signed-off-by: Utsav Anand [email protected]
Description
The --rm flag will enable developers to quickly expose locally running endpoints
and delete the exit nodes when they are done previewing with a
ctrl + c
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Users will be able to use the --rm flag to delete the tunnel as soon as inletsctl is interrupted with
a (control + c). This will make sure any instances are deleted automatically after inletsctl exits with an interrupt.
A great feature for Web-Devs who want to give a preview of their projects with reviewers for a short while
Checklist:
I have:
git commit -s