inlets / inletsctl

Create inlets servers on the top cloud platforms
https://docs.inlets.dev/
MIT License
463 stars 61 forks source link

Packet provider: project-id required #52

Closed vielmetti closed 4 years ago

vielmetti commented 4 years ago

In the Packet provider, if you omit the --project-id flag, you get a 404 error when you attempt to create the machine instead of a working machine.

https://github.com/inlets/inletsctl/issues/5#issuecomment-582791212

I think but am not 100% sure that this is also true for GCE.

Expected Behaviour

If the --project-id flag is omitted, a message should appear stating that it's required.

Current Behaviour

Command to create a server is accepted without the --project-id flag, and the response looks like this:

ed@iyengar:~$ inletsctl create --provider packet --access-token VBGBq525BcpXXXXXXXXXXX
Using provider: packet
Requesting host: charming-brown5 in ams1, from packet
POST https://api.packet.net/projects//devices: 404 Not found

Possible Solution

At https://github.com/inlets/inletsctl/blob/master/cmd/create.go#L156 where --project-id is parsed, introduce a check to see that it's of non-zero length if it's required for the provider.

Context

This came up in the course of a first-time test to get inletsctl running and was easy to remedy.

Your Environment

vielmetti commented 4 years ago

Thanks for fixing this!

alexellis commented 4 years ago

You're welcome. Hope it's useful to the community. I'd love to see it used more