Skip to content
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

Decouple web terminal idle timeout from DevWorkspace idle timeout #114

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented Mar 10, 2022

What does this PR do?

Set timeout for web terminals through an environment variable in the web-terminal-exec plugin rather than through the automatically provisioned DEVWORKSPACE_IDLE_TIMEOUT environment variable. This allows
the timeout for individual terminals to be changed without overriding the timeout for all DevWorkspaces

The main reason to update the idle timeout currently is that the bash history is erased when a Web Terminal is idled. By setting a longer duration, a session could continue for e.g. a full work day.

What issues does this PR fix or reference?

We've had a number of requests for how to increase the web terminal timeout, which normally requires editing the DevWorkspace Operator config or the web-terminal-exec. With these changes, it's easy to override the timeout for individual web terminals in a persistent way.

Is it tested? How?

Start a web terminal with these changes and verify that the updated variable is used for idle timeout. To shorten it for the current web terminal, paste and execute the command

kubectl get dw -o json \
  -n $(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) \
  $DEVWORKSPACE_NAME \
  | jq '.spec.template.components[1].plugin.components = [{
      "name": "web-terminal-exec",
      "container": {
        "env": [{
          "name": "WEB_TERMINAL_IDLE_TIMEOUT",
          "value": "15s",
        }]
      },
    }]' \
  | kubectl apply -f -

@amisevsk amisevsk requested a review from ibuziuk March 10, 2022 22:59
Set timeout for web terminals through an environment variable in the
web-terminal-exec plugin rather than through the automatically
provisioned DEVWORKSPACE_IDLE_TIMEOUT environment variable. This allows
the timeout for individual terminals to be changed without overriding
the timeout for all DevWorkspaces

Signed-off-by: Angel Misevski <[email protected]>
@amisevsk amisevsk force-pushed the customize-idle-timeout branch from f244341 to 2cf835c Compare March 11, 2022 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants