devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.3k stars 361 forks source link

Can't force a space to sleep when port forwarding is running #1313

Open danieleh11 opened 3 years ago

danieleh11 commented 3 years ago

What happened? developer is using a space, once he leaves the space by mistake in port-forwarding (devspace dev) i can put the space to sleep.

What did you expect to happen instead? tried to force the space to sleep.

How can we reproduce the bug? (as minimally and precisely as possible) run port forwarding on a space and try put the space to sleep.

Local Environment:

Kubernetes Cluster:

Anything else we need to know?

/kind bug

FabianKramm commented 3 years ago

@danieleh11 thanks for opening this issue! We'll add an option for this to loft very soon.

However, we were also thinking about adding an option to devspace to automatically exit after the user is inactive for a certain time period, which would help with your issue. What do you think about that?

danieleh11 commented 3 years ago

Hey, sounds good, can I control the time limit for how long if the user will be inactive?

FabianKramm commented 3 years ago

@danieleh11 yes we would add that

danieleh11 commented 3 years ago

Great Thanks.

Chrislevi commented 3 years ago

@FabianKramm Is there a status regarding this feature?

FabianKramm commented 3 years ago

@Chrislevi @danieleh11 unfortunately detecing mouse or keyboard input in golang is not a trivial task because of cross compiling issues and CGO, so I think we'll wait with implementing this feature until we find a way to do this without CGO.

Regarding the original problem, that a space cannot be forced sleeping if port-forwarding is still running: we added a new feature in loft v1.7.0, where you can prevent spaces from waking up for a certain time frame, which should solve this problem.