inletsctl: Generated output command for Delete results in error for gce provider
Expected Behaviour
Copy and paste the command from the generated output should work
Current Behaviour
Running the command as it is output results in the following error:
$ inletsctl delete --provider gce --id "hungry-shaw4|us-central1-a|burtonr"
Using provider: gce
failed to get 'inlets-token' value.: flag accessed but not defined: inlets-token
This was the output generated by the create command:
Inlets OSS exit-node summary:
IP: XXX.XXX.XXX.XXX
Auth-token: someReallyLongTokenString
Command:
export UPSTREAM=http://127.0.0.1:8000
inlets client --remote "ws://XXX.XXX.XXX.XXX:8080" \
--token "someReallyLongTokenString" \
--upstream $UPSTREAM
To Delete:
inletsctl delete --provider gce --id "hungry-shaw4|us-central1-a|burtonr"
Possible Solution
Update the generated command, or update the process to provide the proper functionality.
I did do a repo search in GitHub for the text “inlets-token” and was only able to find it referenced in the create.go file. Not sure why or how it’s ending up being referenced in the delete command.
Steps to Reproduce (for bugs)
- Run
inletsctl create... - Copy the command under the text “To Delete:”
- Paste the command into the terminal and execute
Context
Created an exit node on Google Cloud to test with. Now wanting to delete it, I cannot use the command provided, but instead need to log in to the GCP console
Your Environment
- inlets version
inlets --version
FYI: This should be updated to say
inletsctl version
Version: 0.4.0 Git Commit: 26ec251844703cb649b3c024db7406ec2631107f
- Docker/Kubernetes version
docker version/kubectl version: N/A - Operating System and version (e.g. Linux, Windows, MacOS): Linux
- Link to your project or a code example to reproduce issue: N/A
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (13 by maintainers)
0.4.1seems to work 👍@alexellis, @burtonr and @utsavanand2 I know what the issue is and will raise a PR to fix it. The issue is here
https://github.com/inlets/inletsctl/blob/3f1c896a5ac31d0ee7651a8074fc687e7f0c27ff/pkg/provision/gce.go#L184
I introduced this when I added the delete by IP functionality, the problem is that the project-id from the instance name string is not being used.
Apologies, I did not test the normal delete functionality when I added the delete by ip functionality.
@adamjohnson01 @utsavanand2 please can you take a look into this?