koyeb / koyeb-cli

Koyeb cli
Apache License 2.0
56 stars 29 forks source link

allow to create/update a service without routes #207

Closed brmzkw closed 5 months ago

brmzkw commented 5 months ago

On Koyeb, routes are optional. If the route is not specified, the service is only accessible from the mesh network.

The function setDefaultPortsAndRoutes of services.go forces to always have a route by doing the following:

We should allow the following:

To do so, we can add a new flag --public (defaults true). When false, no default route should be generated. If --public=false is set, we should remove the routes. If --public=false is set with --routes, we should return an error.

We also need to handle the case where the service is not public, and koyeb service update xx/xx is called (without specifying the route). In this case, the route should not be generated.